-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 2.26 KB
/
publish-artifact-bundle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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/