Merge pull request #465 from neo4j/changeset-release/main #380
This file contains 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: | |
branches: ["main"] | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
environment: | |
name: npm | |
outputs: | |
published: ${{ steps.changesets.outputs.published }} | |
published-packages: ${{ steps.changesets.outputs.publishedPackages }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Setup Node.js 16.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install Dependencies | |
run: npm install | |
- name: Configure git | |
run: | | |
git config --global user.name 'Neo4j Team GraphQL' | |
git config --global user.email '[email protected]' | |
- name: Creating .npmrc | |
run: | | |
cat << EOF > "$HOME/.npmrc" | |
@neo4j:registry https://registry.npmjs.org | |
//registry.npmjs.org/:_authToken=$NPM_TOKEN | |
EOF | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9 | |
with: | |
publish: npm run release | |
title: Release new version - changesets | |
env: | |
GITHUB_TOKEN: ${{ secrets.NEO4J_TEAM_GRAPHQL_PERSONAL_ACCESS_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
docs: | |
needs: | |
- release | |
if: ${{ needs.release.outputs.published == 'true' }} | |
uses: ./.github/workflows/docs.yml | |
secrets: inherit | |
# slack-notify: | |
# needs: | |
# - release | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# package: ${{ fromJson(needs.release.outputs.published-packages) }} | |
# steps: | |
# - name: Send Slack announcement of release | |
# uses: slackapi/[email protected] | |
# with: | |
# payload: '{"version":"${{ matrix.package.version }}"}' | |
# env: | |
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_RELEASE_ANNOUNCEMENT_WEBHOOK_URL }} |