diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 77ab322..be234b0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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: @@ -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}}