Skip to content

Commit

Permalink
fix(goreleaser): goreleaser workflow to fetch git tag (#16)
Browse files Browse the repository at this point in the history
* fix(goreleaser): goreleaser workflow to fetch git tag

Signed-off-by: Gyuho Lee <[email protected]>

* tgz

Signed-off-by: Gyuho Lee <[email protected]>

---------

Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho authored Aug 20, 2024
1 parent b737c75 commit c4522f2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: goreleaser
# ref. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
on:
push:
branches:
- main
tags:
- "*"

Expand All @@ -19,19 +17,19 @@ jobs:
job:
- os: ubuntu-22.04
platform: linux
target: linux-x86_64
target: linux_amd64

# - os: ubuntu-22.04
# platform: linux
# target: linux-arm64
# target: linux_arm64

- os: macos-latest
platform: darwin
target: darwin-x86_64
target: darwin_amd64

- os: macos-latest
platform: darwin
target: darwin-arm64
target: darwin_arm64

name: Release ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on: ${{ matrix.job.os }}
Expand All @@ -44,7 +42,7 @@ jobs:
shell: bash
run: |
case ${{ matrix.job.target }} in
linux-arm64) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
linux_arm64) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
esac
- name: Set up Go
Expand All @@ -60,15 +58,20 @@ jobs:
# https://github.com/goreleaser/goreleaser-action
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --config .goreleaser-${{ matrix.job.target }}.yaml
args: release --config .goreleaser_${{ matrix.job.target }}.yaml
workdir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get tag version
if: startsWith(github.ref, 'refs/tags/')
id: get_tag_version
run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT

- name: Release latest
uses: softprops/action-gh-release@v1
if: ${{ github.ref == 'refs/heads/main' }}
Expand All @@ -79,4 +82,4 @@ jobs:
prerelease: false
body: Latest builds from the last commit
files: |
./dist/gpud-${{ matrix.job.target }}.tar.gz
./dist/gpud_${{steps.get_tag_version.outputs.TAG_VERSION}}_${{ matrix.job.target }}.tgz
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ builds:
archives:

- id: gpud
format: tar.gz
format: tgz

# "builds" reference which build instances should be archived in this archive
builds:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ builds:
archives:

- id: gpud
format: tar.gz
format: tgz

# "builds" reference which build instances should be archived in this archive
builds:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ builds:
archives:

- id: gpud
format: tar.gz
format: tgz

# "builds" reference which build instances should be archived in this archive
builds:
Expand Down

0 comments on commit c4522f2

Please sign in to comment.