Skip to content

Commit

Permalink
Merge pull request #69 from asdf-vm/tb/build-release-binaries
Browse files Browse the repository at this point in the history
feat(golang-rewrite): build dev release binaries
  • Loading branch information
Stratus3D authored Sep 21, 2024
2 parents 5969436 + 5e00f82 commit e228c6f
Showing 1 changed file with 36 additions and 27 deletions.
63 changes: 36 additions & 27 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Release (and build Golang binaries)
# This workflow should eventually replace the one in release.yml completely.

permissions:
contents: "write"
contents: write
packages: write

# Eventually this workflow will only be run when a
#on:
Expand Down Expand Up @@ -42,16 +42,14 @@ on:
# docs/zh-hans/guide/getting-started.md

jobs:

create-release:
name: create-release
generate-release-tag:
name: generate-release-tag
runs-on: ubuntu-22.04
# env:
# Set to force version number, e.g., when no tag exists.
# ASDF_VERSION: TEST-0.1.0
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
asdf_version: ${{ env.ASDF_VERSION }}
tag: ${{ env.ASDF_VERSION }}
steps:
- name: Get the release version from the tag
shell: bash
Expand All @@ -63,39 +61,50 @@ jobs:
#echo "ASDF_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
# Once we're using this for real releases we'll want to change this
# line below to contain the actual tag name
echo "ASDF_VERSION=0.0.0" >> "$GITHUB_ENV"
echo "ASDF_VERSION=$(echo "$GITHUB_SHA" | cut -c1-7)" >> "$GITHUB_ENV"
echo "version is: ${{ env.ASDF_VERSION }}"
create-release:
name: create-release
needs: generate-release-tag
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Create GitHub release
id: release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.ASDF_VERSION }}
name: ${{ env.ASDF_VERSION }}
tag: ${{ needs.generate-release-tag.outputs.tag }}
name: ${{ needs.generate-release-tag.outputs.tag }}

build:
needs: create-release
name: Build Go release binaries
needs: [create-release, generate-release-tag]
runs-on: ubuntu-latest
strategy:
matrix:
# windows isn't working on windows right now, add it to this list once
# I fix the code.
goos: [linux, darwin]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
#- goarch: arm64
# goos: windows
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.5'
cache: true
-
name: Run GoReleaser
# Downgraded to version 4 to get snapshot feature working
uses: goreleaser/goreleaser-action@v4
- name: Build Go binaries
uses: wangyoucao577/go-release-action@v1
with:
version: latest
args: release --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "1.21.5"
binary_name: "asdf"
release_tag: ${{ needs.generate-release-tag.outputs.tag }}
release_name: ${{ needs.generate-release-tag.outputs.tag }}

0 comments on commit e228c6f

Please sign in to comment.