Skip to content

Commit

Permalink
chore: added release github actions (#3)
Browse files Browse the repository at this point in the history
* chore: added release github actions

* chore: update version
  • Loading branch information
blackironj committed Jul 29, 2024
1 parent 5325836 commit a93f1dd
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release Pipeline

on:
release:
types: [published]

jobs:
build-publish:
name: Build binary
runs-on: ubuntu-latest
strategy:
matrix:
include:
- build-goos: linux
build-arch: amd64
ext: ''
- build-goos: windows
build-arch: amd64
ext: '.exe'
- build-goos: darwin
build-arch: amd64
ext: ''
- build-goos: darwin
build-arch: arm64
ext: ''

steps:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: 1.21.x

- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ matrix.build-goos }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ matrix.build-goos }}-go-
- name: Set release output name
id: set-tag
run: |
echo "OUTPUT_NAME=panorama-${{ github.ref_name }}-${{ matrix.build-goos }}-${{ matrix.build-arch }}${{ matrix.ext }}" >> $GITHUB_OUTPUT
- name: Build
run: |
CGO_ENABLED=0 GOOS=${{ matrix.build-goos }} GOARCH=${{ matrix.build-arch }} go build -o "${{ steps.set-tag.outputs.OUTPUT_NAME }}" .
- name: Publish binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: "${{ steps.set-tag.outputs.OUTPUT_NAME }}"
tag: ${{ github.ref }}

0 comments on commit a93f1dd

Please sign in to comment.