Skip to content

.github/workflows/publish-artifact-bundle.yml #25

.github/workflows/publish-artifact-bundle.yml

.github/workflows/publish-artifact-bundle.yml #25

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: Update Plugin Version
run: |
# The example binary includes a leading 'v' in the release version number. We drop it on the next line.
echo "PLUGIN_VERSION=$(echo $PLUGIN_VERSION | cut -c2-)" >> $GITHUB_ENV
- name: Set info.json version
run: |
sed -i '' "s/<VERSION>/${{ env.PLUGIN_VERSION }}/g" Plugin-Repo/Resources/template.artifactbundle/info.json
- name: Add executable permissions
run: |
# The example binary includes a leading 'v' in the release version number. We drop it on the next line.
PLUGIN_VERSION="${PLUGIN_VERSION#?}"
# The example binaries for MacOS need the executable permission added.
chmod +x "${{ env.PLUGIN_PATH }}/Resources/template.artifactbundle/lefthook_${{ env.PLUGIN_VERSION }}_MacOS_arm64"
chmod +x "${{ env.PLUGIN_PATH }}/Resources/template.artifactbundle/lefthook_${{ env.PLUGIN_VERSION }}_MacOS_x86_64"
- name: Zip Artifact Bundle
run: |
zip -9 -r template.artifactbundle.zip ${{ env.PLUGIN_PATH }}/Resources/template.artifactbundle/