Skip to content

Commit

Permalink
Add manual artifactsbundle build trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Nov 27, 2024
1 parent 2e70de4 commit 808e434
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
name: Build Release Artifacts

on:
release:
types: [published]
name: Build Release Artifacts
workflow_dispatch:
inputs:
ref:
description: 'Ref to build (branch, tag or SHA)'
required: false
default: 'main'

jobs:
macos:
name: Build macOS binary
Expand Down Expand Up @@ -71,7 +79,7 @@ jobs:
- name: Display structure of downloaded files
run: ls -R downloaded_artifacts
- name: Build artifact bundle
run: ./Scripts/spm-artifact-bundle.sh ${{ github.event.release.name }} downloaded_artifacts/swiftformat_macos/swiftformat downloaded_artifacts/swiftformat_linux/swiftformat_linux downloaded_artifacts/swiftformat_linux_aarch64/swiftformat_linux_aarch64
run: ./Scripts/spm-artifact-bundle.sh downloaded_artifacts/swiftformat_macos/swiftformat downloaded_artifacts/swiftformat_linux/swiftformat_linux downloaded_artifacts/swiftformat_linux_aarch64/swiftformat_linux_aarch64
- name: Upload artifact bundle
uses: skx/github-action-publish-binaries@master
env:
Expand Down
11 changes: 6 additions & 5 deletions Scripts/spm-artifact-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

set -e

MAC_EXECUTABLE=${1:-CommandLineTool/swiftformat}
LINUX_EXECUTABLE=${2:-CommandLineTool/swiftformat_linux}
LINUX_AARCH64_EXECUTABLE=${3:-CommandLineTool/swiftformat_linux_aarch64}

# By default, parses the current version from `Sources/SwiftFormat.swift`.
# Can be overridden by passing in custom version number as argument, e.g.
# `./Scripts/spm-artifact-bundle.sh VERSION_NUMBER`.
VERSION=${1:-$(./Scripts/get-version.sh)}
MAC_EXECUTABLE=${2:-CommandLineTool/swiftformat}
LINUX_EXECUTABLE=${3:-CommandLineTool/swiftformat_linux}
LINUX_AARCH64_EXECUTABLE=${4:-CommandLineTool/swiftformat_linux_aarch64}
# `./Scripts/spm-artifact-bundle.sh ... VERSION_NUMBER`.
VERSION=${4:-$(./Scripts/get-version.sh)}

ARTIFACT_BUNDLE=swiftformat.artifactbundle
INFO_TEMPLATE=Scripts/spm-artifact-bundle-info.template
Expand Down

0 comments on commit 808e434

Please sign in to comment.