From 39321017f51e402a7738dbc04811b98e5b8935d7 Mon Sep 17 00:00:00 2001 From: lanath Date: Wed, 4 Dec 2024 14:46:30 +0100 Subject: [PATCH] ci(github): create tag and release --- .github/workflows/build.yaml | 40 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 1 + 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 77ab322..0b07dd8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -44,3 +44,43 @@ jobs: 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}} + + - name: Download stamusd + uses: actions/download-artifact@v4 + with: + name: 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}} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..792d600 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1 @@ +#