|
1 | 1 | name: installer_release |
2 | 2 |
|
3 | 3 | on: |
4 | | - release: |
5 | | - types: [published] |
| 4 | + workflow_dispatch: |
| 5 | + workflow_run: |
| 6 | + workflows: ["Deploy Update to Live Server"] |
| 7 | + types: |
| 8 | + - completed |
6 | 9 |
|
7 | 10 | permissions: |
8 | 11 | contents: read |
9 | 12 |
|
10 | 13 | jobs: |
11 | 14 | make_installer: |
12 | 15 | 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 }} |
13 | 19 | steps: |
14 | 20 | # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on |
15 | 21 | # configuring harden-runner and identifying allowed endpoints. |
|
20 | 26 | allowed-endpoints: > |
21 | 27 | *-docker.pkg.dev:443 |
22 | 28 | *.cloudfront.net:443 |
| 29 | + api.github.com:443 |
23 | 30 | azure.archive.ubuntu.com:80 |
24 | 31 | cdn.dl.k8s.io:443 |
25 | 32 | dl.k8s.io:443 |
@@ -47,10 +54,16 @@ jobs: |
47 | 54 | sudo apt-get update |
48 | 55 | sudo apt-get install -y makeself |
49 | 56 | 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 |
50 | 63 | - name: Make installer with release version |
51 | 64 | run: | |
52 | 65 | cd installer |
53 | | - ./make-combine-installer.sh ${{ github.event.release.tag_name }} --debug |
| 66 | + ./make-combine-installer.sh ${{ steps.release.outputs.tag }} --debug |
54 | 67 | shell: bash |
55 | 68 | - name: Upload installer artifact |
56 | 69 | uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
|
70 | 83 | with: |
71 | 84 | egress-policy: block |
72 | 85 | allowed-endpoints: > |
| 86 | + github.com:443 |
73 | 87 | s3.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443 |
74 | 88 | sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443 |
75 | 89 | - name: Download installer artifact |
|
85 | 99 | aws-region: ${{ secrets.AWS_DEFAULT_REGION }} |
86 | 100 | - name: Upload installer to S3 |
87 | 101 | 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 |
89 | 103 | aws s3 cp installer/combine-installer.run $TARGET --content-type application/octet-stream |
90 | 104 | shell: bash |
0 commit comments