diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2a537d..825b76a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ on: - completed jobs: - version: + release: name: Release GitHub tag runs-on: 'ubuntu-latest' if: ${{ github.event.workflow_run.conclusion == 'success' }} @@ -19,6 +19,7 @@ jobs: contents: write outputs: new_tag: ${{ steps.tag_version.outputs.new_tag }} + changelog: ${{ steps.tag_version.outputs.changelog }} steps: - name: Check out the repo uses: actions/checkout@v4 @@ -30,10 +31,20 @@ jobs: default_bump: minor github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Release with Notes + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.tag_version.outputs.new_tag }} + name: Release ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.tag_version.outputs.changelog }} + draft: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + push: name: Push Docker image to Docker Hub runs-on: ubuntu-latest - needs: [ version ] + needs: [ release ] steps: - name: Check out the repo uses: actions/checkout@v4 @@ -57,13 +68,13 @@ jobs: context: ./ file: ./Dockerfile push: true - tags: ghcr.io/omegion/ssh-manager:latest,ghcr.io/omegion/ssh-manager:${{ needs.version.outputs.new_tag }} + tags: ghcr.io/omegion/ssh-manager:latest,ghcr.io/omegion/ssh-manager:${{ needs.release.outputs.new_tag }} platforms: linux/amd64,linux/arm64 - build-args: VERSION=${{ needs.version.outputs.new_tag }} + build-args: VERSION=${{ needs.release.outputs.new_tag }} build: - name: Create Release + name: Build Binary runs-on: 'ubuntu-latest' - needs: [ version ] + needs: [ release ] strategy: matrix: # List of GOOS and GOARCH pairs from `go tool dist list` @@ -94,15 +105,15 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Build run: | - make build TARGETOS="$GOOS" TARGETARCH="$GOARCH" VERSION="${{ needs.version.outputs.new_tag }}" BINARY_NAME="$BINARY_NAME" + make build TARGETOS="$GOOS" TARGETARCH="$GOARCH" VERSION="${{ needs.release.outputs.new_tag }}" BINARY_NAME="$BINARY_NAME" - name: Release with Notes uses: softprops/action-gh-release@v1 with: - tag_name: ${{ needs.version.outputs.new_tag }} - name: Release ${{ needs.version.outputs.new_tag }} - body: ${{ steps.tag_version.outputs.changelog }} + tag_name: ${{ needs.release.outputs.new_tag }} + name: Release ${{ needs.release.outputs.new_tag }} + body: ${{ needs.release.outputs.changelog }} draft: false files: ${{env.BINARY_NAME}} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file