Skip to content

Create github action to create a release based on tag #1

Create github action to create a release based on tag

Create github action to create a release based on tag #1

Workflow file for this run

name: Create Release
on:
push:
tags:
- 'v-test*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [arm64, amd64]
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21.6'
- name: Check out code
uses: actions/checkout@v2
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -v -o vault-kv-search-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: vault-kv-search-${{ matrix.goos }}-${{ matrix.goarch }}
path: ./vault-kv-search-${{ matrix.goos }}-${{ matrix.goos }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./vault-kv-search-${{ matrix.goos }}-${{ matrix.goarch }}
asset_name: vault-kv-search-${{ matrix.goos }}-${{ matrix.goarch }}
asset_content_type: application/octet-stream