Skip to content

Commit

Permalink
fix: Include build files to releases
Browse files Browse the repository at this point in the history
  • Loading branch information
omegion committed Oct 21, 2023
1 parent 726cb23 commit fd71fb5
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ on:
- completed

jobs:
version:
release:
name: Release GitHub tag
runs-on: 'ubuntu-latest'
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
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
Expand All @@ -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
Expand All @@ -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`
Expand Down Expand Up @@ -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 }}

0 comments on commit fd71fb5

Please sign in to comment.