Merge pull request #765 from neo4j/changeset-release/main #650
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
| # NOTE: This filename must be called release.yml. If changed, update the Trusted Publisher settings in npm | |
| name: Release | |
| on: | |
| push: | |
| branches: ["main"] | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read # Required for docs | |
| pages: write # Required for docs | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| environment: npm # Should match the env authorized in npm Trusted Publisher settings | |
| outputs: | |
| published: ${{ steps.changesets.outputs.published }} | |
| published-packages: ${{ steps.changesets.outputs.publishedPackages }} | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Node.js LTS | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 | |
| with: | |
| node-version: lts/* | |
| registry-url: https://registry.npmjs.org | |
| - name: Update npm # Need at least 11.5.1 for OIDC publishing | |
| run: npm install -g npm@latest | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Configure git | |
| run: | | |
| git config --global user.name 'Neo4j Team GraphQL' | |
| git config --global user.email 'team-graphql@neotechnology.com' | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0 | |
| with: | |
| publish: npm run release | |
| title: Release new version - changesets | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.NEO4J_TEAM_GRAPHQL_PERSONAL_ACCESS_TOKEN }} | |
| docs: | |
| needs: | |
| - release | |
| if: ${{ needs.release.outputs.published == 'true' }} | |
| uses: ./.github/workflows/docs.yml | |
| secrets: inherit |