Skip to content

Build Release v12.6.4 #10

Build Release v12.6.4

Build Release v12.6.4 #10

Workflow file for this run

# This workflow:
# - builds and uploads a binary artifact for macOS amd64 (compatible with 10.15+)
# - tests act on macOS
# - releases the binary artifacts as a GitHub release
name: Build Release
run-name: Build Release ${{ inputs.tag }}
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
type: string
required: true
goal:
description: 'Goal of run'
type: choice
required: false
options:
- release
- draft
default: draft
jobs:
build:
name: Build
runs-on: macos-latest
steps:
- name: Checkout code
run: |
git clone --depth 1 --branch ${{ inputs.tag }} https://code.forgejo.org/forgejo/runner.git .
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build for macOS amd64
env:
CGO_ENABLED: 1
GOOS: darwin
GOARCH: amd64
MACOSX_DEPLOYMENT_TARGET: 10.15
run: |
go build \
-ldflags "-s -w -X code.forgejo.org/forgejo/runner/v12/internal/pkg/ver.version=${{ inputs.tag }}" \
-o forgejo-runner-darwin-amd64
- name: Check Version Output
run: |
VERSION_OUTPUT=$(./forgejo-runner-darwin-amd64 --version)
if [ "$VERSION_OUTPUT" != "forgejo-runner version ${{ inputs.tag }}" ]; then
echo "Version mismatch: got $VERSION_OUTPUT expected forgejo-runner version ${{ inputs.tag }}"
exit 1
fi
otool -l ./forgejo-runner-darwin-amd64 | grep minos -A 3
- uses: actions/upload-artifact@v4
with:
name: forgejo-runner-darwin-amd64
path: forgejo-runner-darwin-amd64
test-act:
name: Run Act Tests on macOS
runs-on: macos-latest
steps:
- name: macOS - Checkout code
run: |
git clone --depth 1 --branch ${{ inputs.tag }} https://code.forgejo.org/forgejo/runner.git .
- name: macOS - Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: macOS - Install dependencies
run: go mod download
- name: macOS - Run tests
run: go test -v ./act/... || true
env:
ACT_REPOSITORY: forgejo/runner
release:
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: .
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag }}
files: forgejo-runner-darwin-*/forgejo-runner-darwin-*
draft: ${{ needs.test-act.result != 'success' || inputs.goal != 'release' }}
prerelease: ${{ contains(inputs.tag, 'beta') || contains(inputs.tag, 'alpha') }}
fail_on_unmatched_files: true
body: |
See [original release notes](https://code.forgejo.org/forgejo/runner/releases/tag/${{ inputs.tag }}).
Forgejo runner:
- [Source Code (zip)](https://code.forgejo.org/forgejo/runner/archive/${{ inputs.tag }}.zip)
- [Source Code (tar.gz)](https://code.forgejo.org/forgejo/runner/archive/${{ inputs.tag }}.tar.gz)