Release 3.2.0 #3
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: Draft Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to release (e.g. v2.11.0). Leave empty to use package.json version.' | |
| required: false | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.30.0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Typecheck | |
| run: pnpm run typecheck | |
| - name: Run tests | |
| run: pnpm test | |
| - name: Build | |
| run: pnpm run build | |
| - name: Determine tag | |
| id: tag | |
| run: | | |
| if [[ "${{ github.event_name }}" == "push" ]]; then | |
| echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
| elif [[ -n "${{ github.event.inputs.tag }}" ]]; then | |
| echo "version=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| else | |
| VERSION="v$(node -p 'require("./package.json").version')" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create draft release | |
| run: | | |
| gh release create "${{ steps.tag.outputs.version }}" \ | |
| google_photos_toolkit.user.js \ | |
| --draft \ | |
| --title "${{ steps.tag.outputs.version }}" \ | |
| --generate-notes | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |