|
| 1 | +name: installer |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + branches: [master] |
| 8 | + paths: |
| 9 | + - ".github/workflows/installer.yml" |
| 10 | + - "installer/**" |
| 11 | + |
| 12 | +concurrency: |
| 13 | + cancel-in-progress: true |
| 14 | + group: ${{ github.workflow }}-${{ github.ref_protected && github.run_id || github.event.pull_request.number }} |
| 15 | + |
| 16 | +permissions: # added using https://github.com/step-security/secure-workflows |
| 17 | + contents: read |
| 18 | + |
| 19 | +jobs: |
| 20 | + make_installer: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on |
| 24 | + # configuring harden-runner and identifying allowed endpoints. |
| 25 | + - name: Harden Runner |
| 26 | + uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 |
| 27 | + with: |
| 28 | + egress-policy: block |
| 29 | + allowed-endpoints: > |
| 30 | + *-docker.pkg.dev:443 |
| 31 | + *.cloudfront.net:443 |
| 32 | + azure.archive.ubuntu.com:80 |
| 33 | + cdn.dl.k8s.io:443 |
| 34 | + dl.k8s.io:443 |
| 35 | + esm.ubuntu.com:443 |
| 36 | + files.pythonhosted.org:443 |
| 37 | + get.helm.sh:443 |
| 38 | + get.k3s.io:443 |
| 39 | + github.com:443 |
| 40 | + kubernetes.github.io:443 |
| 41 | + packages.microsoft.com:443 |
| 42 | + prod-registry-k8s-io-us-east-1.s3.dualstack.us-east-1.amazonaws.com:443 |
| 43 | + prod-registry-k8s-io-us-east-2.s3.dualstack.us-east-2.amazonaws.com:443 |
| 44 | + prod-registry-k8s-io-us-west-1.s3.dualstack.us-west-1.amazonaws.com:443 |
| 45 | + prod-registry-k8s-io-us-west-2.s3.dualstack.us-west-2.amazonaws.com:443 |
| 46 | + public.ecr.aws:443 |
| 47 | + pypi.org:443 |
| 48 | + registry.k8s.io:443 |
| 49 | + release-assets.githubusercontent.com:443 |
| 50 | + - name: Checkout repository |
| 51 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 52 | + with: |
| 53 | + fetch-depth: 0 |
| 54 | + - name: Install dependencies |
| 55 | + run: | |
| 56 | + sudo apt-get update |
| 57 | + sudo apt-get install -y makeself |
| 58 | + shell: bash |
| 59 | + - name: Make installer with --net-install |
| 60 | + run: | |
| 61 | + cd installer |
| 62 | + ./make-combine-installer.sh --net-install --debug |
| 63 | + shell: bash |
| 64 | + - name: Upload net-installer artifact |
| 65 | + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 |
| 66 | + with: |
| 67 | + name: combine-net-installer |
| 68 | + path: installer/combine-net-installer.run |
| 69 | + retention-days: 5 |
| 70 | + - name: Make installer with release version |
| 71 | + run: | |
| 72 | + cd installer |
| 73 | + ./make-combine-installer.sh $(git describe --tags --abbrev=0) --debug |
| 74 | + shell: bash |
| 75 | + - name: Show size of installer files |
| 76 | + run: | |
| 77 | + cd installer |
| 78 | + du -sh * |
| 79 | + shell: bash |
| 80 | + |
| 81 | + make_readme: |
| 82 | + runs-on: ubuntu-latest |
| 83 | + steps: |
| 84 | + # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on |
| 85 | + # configuring harden-runner and identifying allowed endpoints. |
| 86 | + - name: Harden Runner |
| 87 | + uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 |
| 88 | + with: |
| 89 | + egress-policy: block |
| 90 | + allowed-endpoints: > |
| 91 | + azure.archive.ubuntu.com:80 |
| 92 | + esm.ubuntu.com:443 |
| 93 | + github.com:443 |
| 94 | + packages.microsoft.com:443 |
| 95 | + s3.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443 |
| 96 | + sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443 |
| 97 | + - name: Checkout repository |
| 98 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 99 | + with: |
| 100 | + fetch-depth: 2 |
| 101 | + - name: Detect changes to installer README |
| 102 | + id: changed-readme |
| 103 | + run: | |
| 104 | + if git diff --name-only HEAD~1.. | grep -q "^installer/README.md$"; then |
| 105 | + echo "changed=true" >> $GITHUB_OUTPUT |
| 106 | + else |
| 107 | + echo "changed=false" >> $GITHUB_OUTPUT |
| 108 | + fi |
| 109 | + shell: bash |
| 110 | + - name: Install dependencies |
| 111 | + run: | |
| 112 | + sudo apt-get update |
| 113 | + sudo apt-get install -y pandoc weasyprint |
| 114 | + shell: bash |
| 115 | + - name: Generate README PDF |
| 116 | + run: | |
| 117 | + cd installer |
| 118 | + pandoc --pdf-engine=weasyprint --metadata title="The Combine Installation Instructions" README.md -o README.pdf |
| 119 | + shell: bash |
| 120 | + - name: Configure AWS credentials |
| 121 | + if: steps.changed-readme.outputs.changed == 'true' && github.event_name == 'push' |
| 122 | + uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0 |
| 123 | + with: |
| 124 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 125 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 126 | + aws-region: ${{ secrets.AWS_DEFAULT_REGION }} |
| 127 | + - name: Upload README to S3 |
| 128 | + if: steps.changed-readme.outputs.changed == 'true' && github.event_name == 'push' |
| 129 | + run: | |
| 130 | + aws s3 cp installer/README.pdf s3://software.thecombine.app/README.pdf --content-type application/pdf |
| 131 | + shell: bash |
| 132 | + |
| 133 | + upload_net_installer: |
| 134 | + needs: make_installer |
| 135 | + runs-on: ubuntu-latest |
| 136 | + steps: |
| 137 | + # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on |
| 138 | + # configuring harden-runner and identifying allowed endpoints. |
| 139 | + - name: Harden Runner |
| 140 | + uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 |
| 141 | + with: |
| 142 | + egress-policy: block |
| 143 | + allowed-endpoints: > |
| 144 | + azure.archive.ubuntu.com:80 |
| 145 | + esm.ubuntu.com:443 |
| 146 | + github.com:443 |
| 147 | + packages.microsoft.com:443 |
| 148 | + s3.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443 |
| 149 | + sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443 |
| 150 | + - name: Checkout repository |
| 151 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 152 | + with: |
| 153 | + fetch-depth: 2 |
| 154 | + - name: Detect changes to make-combine-installer.sh |
| 155 | + id: changed-installer |
| 156 | + run: | |
| 157 | + if git diff --name-only HEAD~1.. | grep -q "^installer/make-combine-installer.sh$"; then |
| 158 | + echo "changed=true" >> $GITHUB_OUTPUT |
| 159 | + else |
| 160 | + echo "changed=false" >> $GITHUB_OUTPUT |
| 161 | + fi |
| 162 | + shell: bash |
| 163 | + - name: Download net-installer artifact |
| 164 | + if: steps.changed-installer.outputs.changed == 'true'&& github.event_name == 'push' |
| 165 | + uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 |
| 166 | + with: |
| 167 | + name: combine-net-installer |
| 168 | + path: installer/ |
| 169 | + - name: Configure AWS credentials |
| 170 | + if: steps.changed-installer.outputs.changed == 'true' && github.event_name == 'push' |
| 171 | + uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0 |
| 172 | + with: |
| 173 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 174 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 175 | + aws-region: ${{ secrets.AWS_DEFAULT_REGION }} |
| 176 | + - name: Upload net-installer to S3 |
| 177 | + if: steps.changed-installer.outputs.changed == 'true' && github.event_name == 'push' |
| 178 | + run: | |
| 179 | + aws s3 cp installer/combine-net-installer.run s3://software.thecombine.app/combine-net-installer.run --content-type application/octet-stream |
| 180 | + shell: bash |
0 commit comments