Skip to content

Commit

Permalink
ci: Fixed getting release version
Browse files Browse the repository at this point in the history
  • Loading branch information
bahattincinic committed May 30, 2024
1 parent 90369cc commit 4953406
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: Release
on: [workflow_dispatch]

jobs:
tag:
runs-on: ubuntu-latest

outputs:
new_tag: ${{ steps.tag_version.outputs.new_tag }}

steps:
- uses: actions/checkout@v2
- name: Push Tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
Expand All @@ -18,12 +22,14 @@ jobs:
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
draft: false

release:
runs-on: ubuntu-latest
needs: tag
strategy:
matrix:
goos: [darwin, linux, windows]

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -33,35 +39,28 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.19

- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: "12"

- name: Get release
id: release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install NPM packages
run: cd ui && rm package-lock.json && npm install && npm run build

- name: Build Release Binary
run: |
GOOS=${{ matrix.goos }} GOARCH=amd64 make GCFLAGS="-tags=prod"
tar -czvf fitwave_${{ steps.release.outputs.tag_name }}_${{ matrix.goos }}_amd64.tar.gz fitwave
tar -czvf fitwave_${{ needs.tag.outputs.new_tag }}_${{ matrix.goos }}_amd64.tar.gz fitwave
ls
- name: Upload Release Binary
id: upload-go-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./fitwave_${{ steps.release.outputs.tag_name }}_${{ matrix.goos }}_amd64.tar.gz
asset_name: fitwave_${{ steps.release.outputs.tag_name }}_${{ matrix.goos }}_amd64.tar.gz
upload_url: ${{ needs.tag.outputs.new_tag }}
asset_path: ./fitwave_${{ needs.tag.outputs.new_tag }}_${{ matrix.goos }}_amd64.tar.gz
asset_name: fitwave_${{ needs.tag.outputs.new_tag }}_${{ matrix.goos }}_amd64.tar.gz
asset_content_type: application/gzip

0 comments on commit 4953406

Please sign in to comment.