Skip to content

Commit d2f2aa3

Browse files
authored
[gha] Trigger installer_release on deploy_release (#4083)
Also, enable manual triggering
1 parent 6f665a9 commit d2f2aa3

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/installer_release.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
name: installer_release
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_dispatch:
5+
workflow_run:
6+
workflows: ["Deploy Update to Live Server"]
7+
types:
8+
- completed
69

710
permissions:
811
contents: read
912

1013
jobs:
1114
make_installer:
1215
runs-on: ubuntu-latest
16+
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
17+
outputs:
18+
release_tag: ${{ steps.release.outputs.tag }}
1319
steps:
1420
# See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on
1521
# configuring harden-runner and identifying allowed endpoints.
@@ -20,6 +26,7 @@ jobs:
2026
allowed-endpoints: >
2127
*-docker.pkg.dev:443
2228
*.cloudfront.net:443
29+
api.github.com:443
2330
azure.archive.ubuntu.com:80
2431
cdn.dl.k8s.io:443
2532
dl.k8s.io:443
@@ -47,10 +54,16 @@ jobs:
4754
sudo apt-get update
4855
sudo apt-get install -y makeself
4956
shell: bash
57+
- name: Get latest release tag
58+
env:
59+
GH_TOKEN: ${{ github.token }}
60+
id: release
61+
run: |
62+
echo "tag=$(gh release view --json tagName -q .tagName)" >> $GITHUB_OUTPUT
5063
- name: Make installer with release version
5164
run: |
5265
cd installer
53-
./make-combine-installer.sh ${{ github.event.release.tag_name }} --debug
66+
./make-combine-installer.sh ${{ steps.release.outputs.tag }} --debug
5467
shell: bash
5568
- name: Upload installer artifact
5669
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
@@ -70,6 +83,7 @@ jobs:
7083
with:
7184
egress-policy: block
7285
allowed-endpoints: >
86+
github.com:443
7387
s3.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
7488
sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
7589
- name: Download installer artifact
@@ -85,6 +99,6 @@ jobs:
8599
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
86100
- name: Upload installer to S3
87101
run: |
88-
TARGET=s3://software.thecombine.app/combine-installer-${{ github.event.release.tag_name }}.run
102+
TARGET=s3://software.thecombine.app/combine-installer-${{ needs.make_installer.outputs.release_tag }}.run
89103
aws s3 cp installer/combine-installer.run $TARGET --content-type application/octet-stream
90104
shell: bash

0 commit comments

Comments
 (0)