chore(release): prepare 0.0.7 (#114) #16
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 | |
| packages: write | |
| jobs: | |
| verify: | |
| name: Verify | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.11 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build | |
| run: bun run build | |
| - name: Test | |
| run: bun test | |
| - name: Lint | |
| run: bun run lint | |
| image: | |
| name: Publish GHCR Image | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| needs: verify | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Resolve release version | |
| id: version | |
| shell: bash | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| echo "created=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/corebunch/instatic | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=raw,value=latest | |
| - name: Build and push image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| INSTATIC_VERSION=${{ steps.version.outputs.version }} | |
| INSTATIC_REVISION=${{ github.sha }} | |
| INSTATIC_CREATED=${{ steps.version.outputs.created }} | |
| bundle: | |
| name: Publish Release Bundle | |
| runs-on: ubuntu-latest | |
| needs: | |
| - verify | |
| - image | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.11 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build release bundle | |
| run: bun run release:bundle -- "${{ needs.image.outputs.version }}" | |
| - name: Create release if missing | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| shell: bash | |
| run: | | |
| if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then | |
| exit 0 | |
| fi | |
| gh release create "$GITHUB_REF_NAME" \ | |
| --title "Instatic ${{ needs.image.outputs.version }}" \ | |
| --generate-notes | |
| - name: Upload release bundle | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release upload "$GITHUB_REF_NAME" \ | |
| ".tmp/release/instatic-${{ needs.image.outputs.version }}-release-bundle.tar.gz" \ | |
| --clobber |