noot #17
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| env: | |
| GITHOOK: 0 | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: production | |
| url: https://githook.sh | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Update version in source | |
| run: | | |
| sed -i 's/^GITHOOK_VERSION=".*"/GITHOOK_VERSION="${{ steps.version.outputs.VERSION }}"/' src/constants.sh | |
| - name: Build | |
| run: make build | |
| - name: Generate checksum | |
| id: checksum | |
| run: | | |
| CHECKSUM=$(sha256sum githook.sh | awk '{print $1}') | |
| echo "SHA256=$CHECKSUM" >> $GITHUB_OUTPUT | |
| - name: Commit version update | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add src/constants.sh | |
| git commit -m "release: v${{ steps.version.outputs.VERSION }}" || echo "No changes to commit" | |
| git push origin main | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: githook.sh | |
| body: | | |
| ## Installation | |
| ```sh | |
| curl -fsS https://githook.sh -o githook.sh | |
| chmod +x githook.sh | |
| ./githook.sh install | |
| ``` | |
| ## Checksum | |
| ``` | |
| sha256:${{ steps.checksum.outputs.SHA256 }} | |
| ``` | |
| - name: Setup Fly.io | |
| uses: superfly/flyctl-actions/setup-flyctl@master | |
| - name: Deploy to Fly.io | |
| run: flyctl deploy --remote-only | |
| env: | |
| FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |