rewrote with signals #7
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: Build and Release | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| - run: bun install | |
| - run: bun run build | |
| - name: Zip build | |
| run: cd dist/angular-conduit/browser && zip -r ../../../build.zip . | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: build-${{ github.run_number }} | |
| files: build.zip | |
| - name: Cleanup old releases | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| releases=$(gh release list --json tagName,createdAt --limit 100) | |
| cutoff=$(date -d '7 days ago' -Iseconds) | |
| echo "$releases" | jq -r ' | |
| to_entries | |
| | .[] | |
| | select(.key >= 5) | |
| | select(.value.createdAt < "'"$cutoff"'") | |
| | .value.tagName | |
| ' | while read -r tag; do | |
| echo "Deleting release: $tag" | |
| gh release delete "$tag" --cleanup-tag -y | |
| done |