chore(install): user-local dir, macOS codesign, skip GitHub API (#55) #4
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: Upload install.sh | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - install.sh | |
| workflow_dispatch: | |
| jobs: | |
| upload: | |
| name: Upload to Bunny Storage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Upload install.sh | |
| env: | |
| BUNNYNET_STORAGE_ENDPOINT: ${{ vars.BUNNYNET_STORAGE_ENDPOINT }} | |
| BUNNYNET_STORAGE_ZONE: ${{ vars.BUNNYNET_STORAGE_ZONE }} | |
| BUNNYNET_STORAGE_PASSWORD: ${{ secrets.BUNNYNET_STORAGE_PASSWORD }} | |
| run: | | |
| CHECKSUM=$(sha256sum install.sh | awk '{print toupper($1)}') | |
| curl --fail --show-error --silent \ | |
| -X PUT \ | |
| -H "AccessKey: ${BUNNYNET_STORAGE_PASSWORD}" \ | |
| -H "Content-Type: application/x-sh" \ | |
| -H "Checksum: ${CHECKSUM}" \ | |
| --upload-file install.sh \ | |
| "https://${BUNNYNET_STORAGE_ENDPOINT}/${BUNNYNET_STORAGE_ZONE}/install.sh" | |
| - name: Purge CDN cache | |
| env: | |
| BUNNYNET_API_KEY: ${{ secrets.BUNNYNET_API_KEY }} | |
| BUNNYNET_INSTALL_URL: ${{ vars.BUNNYNET_INSTALL_URL }} | |
| run: | | |
| ENCODED_URL=$(jq -rn --arg u "$BUNNYNET_INSTALL_URL" '$u|@uri') | |
| curl --fail --show-error --silent \ | |
| -X POST \ | |
| -H "AccessKey: ${BUNNYNET_API_KEY}" \ | |
| "https://api.bunny.net/purge?url=${ENCODED_URL}" |