fix: don't kill the user's shell when the installer aborts #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Install Scripts to R2 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'install/bash/*.sh' | |
| - 'install/powershell/*.ps1' | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| name: Upload to Cloudflare R2 | |
| runs-on: ubuntu-latest | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Upload install scripts to R2 | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
| R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }} | |
| R2_BUCKET: ${{ secrets.R2_BUCKET }} | |
| run: | | |
| aws s3 cp install/bash/install.sh s3://${R2_BUCKET}/install/install.sh \ | |
| --endpoint-url "${R2_ENDPOINT}" \ | |
| --content-type "text/plain" | |
| echo "✓ install.sh uploaded to R2" | |
| aws s3 cp install/bash/walkthrough.sh s3://${R2_BUCKET}/install/walkthrough.sh \ | |
| --endpoint-url "${R2_ENDPOINT}" \ | |
| --content-type "text/plain" | |
| echo "✓ walkthrough.sh uploaded to R2" | |
| aws s3 cp install/bash/examples.sh s3://${R2_BUCKET}/install/examples.sh \ | |
| --endpoint-url "${R2_ENDPOINT}" \ | |
| --content-type "text/plain" | |
| echo "✓ examples.sh uploaded to R2" | |
| aws s3 cp install/powershell/install.ps1 s3://${R2_BUCKET}/install/install.ps1 \ | |
| --endpoint-url "${R2_ENDPOINT}" \ | |
| --content-type "text/plain" | |
| echo "✓ install.ps1 uploaded to R2" | |
| aws s3 cp install/powershell/walkthrough.ps1 s3://${R2_BUCKET}/install/walkthrough.ps1 \ | |
| --endpoint-url "${R2_ENDPOINT}" \ | |
| --content-type "text/plain" | |
| echo "✓ walkthrough.ps1 uploaded to R2" | |
| aws s3 cp install/powershell/examples.ps1 s3://${R2_BUCKET}/install/examples.ps1 \ | |
| --endpoint-url "${R2_ENDPOINT}" \ | |
| --content-type "text/plain" | |
| echo "✓ examples.ps1 uploaded to R2" | |
| - name: Notify Slack (success) | |
| if: ${{ success() && env.SLACK_WEBHOOK_URL != '' }} | |
| run: | | |
| curl -s -X POST "$SLACK_WEBHOOK_URL" \ | |
| -H 'Content-type: application/json' \ | |
| --data "{\"text\":\"*Codeplain Client*: Install scripts deployed to R2 :white_check_mark: (\`${GITHUB_SHA:0:7}\`, by *${{ github.actor }}*).\"}" | |
| - name: Notify Slack (failure) | |
| if: ${{ failure() && env.SLACK_WEBHOOK_URL != '' }} | |
| run: | | |
| curl -s -X POST "$SLACK_WEBHOOK_URL" \ | |
| -H 'Content-type: application/json' \ | |
| --data "{\"text\":\"*Codeplain Client*: Install script deploy to R2 FAILED :x: (\`${GITHUB_SHA:0:7}\`). Users may be getting a stale installer. See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.\"}" | |