|
| 1 | +name: installer_release |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + |
| 10 | +jobs: |
| 11 | + make_installer: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on |
| 15 | + # configuring harden-runner and identifying allowed endpoints. |
| 16 | + - name: Harden Runner |
| 17 | + uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 |
| 18 | + with: |
| 19 | + egress-policy: block |
| 20 | + allowed-endpoints: > |
| 21 | + *-docker.pkg.dev:443 |
| 22 | + *.cloudfront.net:443 |
| 23 | + azure.archive.ubuntu.com:80 |
| 24 | + cdn.dl.k8s.io:443 |
| 25 | + dl.k8s.io:443 |
| 26 | + esm.ubuntu.com:443 |
| 27 | + files.pythonhosted.org:443 |
| 28 | + get.helm.sh:443 |
| 29 | + get.k3s.io:443 |
| 30 | + github.com:443 |
| 31 | + kubernetes.github.io:443 |
| 32 | + packages.microsoft.com:443 |
| 33 | + prod-registry-k8s-io-us-east-1.s3.dualstack.us-east-1.amazonaws.com:443 |
| 34 | + prod-registry-k8s-io-us-east-2.s3.dualstack.us-east-2.amazonaws.com:443 |
| 35 | + prod-registry-k8s-io-us-west-1.s3.dualstack.us-west-1.amazonaws.com:443 |
| 36 | + prod-registry-k8s-io-us-west-2.s3.dualstack.us-west-2.amazonaws.com:443 |
| 37 | + public.ecr.aws:443 |
| 38 | + pypi.org:443 |
| 39 | + registry.k8s.io:443 |
| 40 | + release-assets.githubusercontent.com:443 |
| 41 | + - name: Checkout repository |
| 42 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 43 | + with: |
| 44 | + fetch-depth: 0 |
| 45 | + - name: Install dependencies |
| 46 | + run: | |
| 47 | + sudo apt-get update |
| 48 | + sudo apt-get install -y makeself |
| 49 | + shell: bash |
| 50 | + - name: Make installer with release version |
| 51 | + run: | |
| 52 | + cd installer |
| 53 | + ./make-combine-installer.sh ${{ github.event.release.tag_name }} --debug |
| 54 | + shell: bash |
| 55 | + - name: Upload installer artifact |
| 56 | + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 |
| 57 | + with: |
| 58 | + name: combine-installer |
| 59 | + path: installer/combine-installer.run |
| 60 | + retention-days: 5 |
| 61 | + |
| 62 | + upload_installer: |
| 63 | + needs: make_installer |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on |
| 67 | + # configuring harden-runner and identifying allowed endpoints. |
| 68 | + - name: Harden Runner |
| 69 | + uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 |
| 70 | + with: |
| 71 | + egress-policy: block |
| 72 | + allowed-endpoints: > |
| 73 | + s3.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443 |
| 74 | + sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443 |
| 75 | + - name: Download installer artifact |
| 76 | + uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 |
| 77 | + with: |
| 78 | + name: combine-installer |
| 79 | + path: installer/ |
| 80 | + - name: Configure AWS credentials |
| 81 | + uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0 |
| 82 | + with: |
| 83 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 84 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 85 | + aws-region: ${{ secrets.AWS_DEFAULT_REGION }} |
| 86 | + - name: Upload installer to S3 |
| 87 | + run: | |
| 88 | + TARGET=s3://software.thecombine.app/combine-installer-${{ github.event.release.tag_name }}.run |
| 89 | + aws s3 cp installer/combine-installer.run $TARGET --content-type application/octet-stream |
| 90 | + shell: bash |
0 commit comments