.github/workflows/publish-artifact-bundle.yml #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Artifact Bundle | |
on: | |
workflow_call: | |
inputs: | |
binary_version: | |
required: true | |
type: string | |
binary_repo: | |
required: true | |
type: string | |
# Enables manually running this workflow from the Actions tab | |
workflow_dispatch: | |
inputs: | |
binary_version: | |
required: true | |
type: string | |
binary_repo: | |
required: true | |
type: string | |
jobs: | |
publish: | |
name: Publish Artifact Bundle | |
runs-on: macOS-13 | |
env: | |
PLUGIN_VERSION: ${{ inputs.binary_version }} | |
PLUGIN_PATH: Plugin-Repo | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: Plugin-Repo | |
- name: Get latest binaries | |
run: | | |
gh release download ${{ inputs.binary_version }} \ | |
-R "${{ inputs.binary_repo }}" \ | |
-p '*MacOS*64' \ | |
-p '*Linux*64' \ | |
-p '*Windows*64.exe' \ | |
-p '*.deb' \ | |
-p '*.rpm' \ | |
-D '${{ env.PLUGIN_PATH }}/Resources/template.artifactbundle' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set info.json version | |
run: | | |
# The example binary includes a leading 'v' in the release version number. We drop it on the next line. | |
PLUGIN_VERSION="${PLUGIN_VERSION#?}" | |
sed -i '' "s/<VERSION>/$PLUGIN_VERSION/g" Plugin-Repo/Resources/template.artifactbundle/info.json | |
- name: Add executable permissions | |
run: | | |
# The example binaries for MacOS need the executable permission added. | |
chmod +x "${{ env.PLUGIN_PATH }}/Resources/template.artifactbundle/lefthook_${PLUGIN_VERSION#?}_MacOS_arm64" | |
chmod +x "${{ env.PLUGIN_PATH }}/Resources/template.artifactbundle/lefthook_${PLUGIN_VERSION#?}_MacOS_x86_64" | |
- name: Zip Artifact Bundle | |
run: | | |
zip -9 -r template.artifactbundle.zip ${{ env.PLUGIN_PATH }}/Resources/template.artifactbundle/ |