Skip to content

Commit

Permalink
ci(github): create tag and release
Browse files Browse the repository at this point in the history
  • Loading branch information
lanathlor committed Dec 4, 2024
1 parent b96a08f commit 98fa811
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: make cli
run: make cli && mv dist/stamusctl dist/stamusctl-${{matrix.os}}-${{matrix.arch}}
- name: Upload
uses: actions/upload-artifact@v4
with:
Expand All @@ -38,9 +38,51 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: make daemon
run: make daemon && mv dist/stamusd dist/stamusd-${{matrix.os}}-${{matrix.arch}}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: stamusd-${{matrix.os}}-${{matrix.arch}}
path: dist/*

create-tag:
runs-on: ${{ matrix.runner }}
needs: [build-stamusctl, build-stamusdaemon]
strategy:
matrix:
include:
- { runner: ubuntu-latest, os: linux, arch: amd64, go-version: 1.22 }

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: get tag version
id: get_tag_version
run: |
cat VERSION
echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Download stamusctl
uses: actions/download-artifact@v4
with:
name: stamusctl-${{matrix.os}}-${{matrix.arch}}
path: stamusctl-${{matrix.os}}-${{matrix.arch}}

- name: Download stamusd
uses: actions/download-artifact@v4
with:
name: stamusd-${{matrix.os}}-${{matrix.arch}}
path: stamusd-${{matrix.os}}-${{matrix.arch}}

- name: Release snapshot
id: release-snapshot
uses: softprops/action-gh-release@v2
if: github.ref == 'refs/heads/main'
with:
tag_name: ${{ steps.get_tag_version.outputs.version }}
draft: false
prerelease: false
files: |
stamusctl-${{matrix.os}}-${{matrix.arch}}
stamusd-${{matrix.os}}-${{matrix.arch}}

0 comments on commit 98fa811

Please sign in to comment.