release: align metadata for v1.7.1 #50
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 Version Change | |
| on: | |
| push: | |
| paths: | |
| - 'manifest.json' | |
| - 'RELEASE_NOTES.md' | |
| - '.github/workflows/release-on-version-change.yml' | |
| workflow_dispatch: | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Read version from manifest.json | |
| id: read_version | |
| run: | | |
| VERSION=$(jq -r '.version' manifest.json) | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Verify extension registration flow | |
| run: node --test tests/telemetryService.test.mjs | |
| - name: Verify Worker security and data model | |
| run: node --test telemetry-worker/test/*.test.js | |
| - name: Verify manifest, Base64 guide, changelog and release notice | |
| run: node scripts/verify-release.mjs | |
| - name: Check whether release already exists | |
| id: release_state | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if gh release view "$VERSION" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then | |
| echo "Release $VERSION already exists. Skipping." | |
| echo "should_release=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "should_release=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create tag and release | |
| if: steps.release_state.outputs.should_release == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if ! git rev-parse "$VERSION" >/dev/null 2>&1; then | |
| git tag "$VERSION" | |
| git push origin "$VERSION" | |
| fi | |
| gh release create "$VERSION" \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --verify-tag \ | |
| --title "WebDataScope $VERSION Release" \ | |
| --notes-file RELEASE_NOTES.md |