Skip to content

Commit

Permalink
Create github action to create a release based on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
xbglowx committed Feb 2, 2024
1 parent 72d16e1 commit d38fa60
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

name: Build and Test

on: push
on:
push:
tags-ignore:
- 'v*'

jobs:

Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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@v5
with:
go-version: '1.21.6'

- name: Check out code
uses: actions/checkout@v4

- 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@v4
with:
name: vault-kv-search
path: ./vault-kv-search-*
overwrite: true

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v2

- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: false
files: ./vault-kv-search-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d38fa60

Please sign in to comment.