Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #44 from everettraven/actions/release_fix
Browse files Browse the repository at this point in the history
split windows build and unix builds
  • Loading branch information
everettraven authored Nov 14, 2021
2 parents 42d0b18 + 31ff640 commit 4854bd4
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ on:

# Set up the actual workflow jobs
jobs:
# Build the executable on windows and upload it as an artifact to use in the release
build-executables:
# Build the executable on linux and mac and upload it as an artifact to use in the release
build-unix-executables:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest]
# Checkout the repo to build the file
steps:
- name: lowercase Runner OS
Expand All @@ -30,17 +30,35 @@ jobs:
with:
go-version: 1.16.4
- name: Build ${{ runner.os }} packageless with tag as version
run: go build -ldflags "-X github.com/everettraven/packageless/subcommands.version=${{ github.ref }}" -o packageless-${{ env.RUNNER_OS_LOWER }}
run: go build -ldflags "-X github.com/everettraven/packageless/subcommands.version=${{ github.ref_name }}" -o packageless-${{ env.RUNNER_OS_LOWER }}
- name: Upload build artifacts for ${{ runner.os }}
uses: actions/upload-artifact@v2
with:
name: build-${{ env.RUNNER_OS_LOWER }}-${{ github.ref_name }}
path: packageless-${{ env.RUNNER_OS_LOWER }}
# Build the executable on Windows, upload as artifact
build-windows-executable:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.4
- name: Build ${{ runner.os }} packageless with tag as version
run: go build -ldflags "-X github.com/everettraven/packageless/subcommands.version=${{ github.ref_name }}" -o packageless-windows
- name: Upload build artifacts for ${{ runner.os }}
uses: actions/upload-artifact@v2
with:
name: build-windows-${{ github.ref_name }}
path: packageless-windows

# Create the release and upload the executable files
release:
needs: build-executables
needs: [build-unix-executables, build-windows-executable]
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Download Windows build artifact
uses: actions/download-artifact@v2
with:
Expand All @@ -61,5 +79,6 @@ jobs:
packageless-windows
packageless-linux
packageless-macos
config.hcl
generate_release_notes: true

0 comments on commit 4854bd4

Please sign in to comment.