Skip to content

Version Packages (#3891) #85

Version Packages (#3891)

Version Packages (#3891) #85

name: changesets (dev)
on:
push:
branches:
- dev
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@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install Dependencies
run: yarn
- name: Configure git
run: |
git config --global user.name 'Neo4j Team GraphQL'
git config --global user.email 'team-graphql@neotechnology.com'
- 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 PR or release
id: changesets
uses: changesets/action@f13b1baaa620fde937751f5d2c3572b9da32af23 # v1.4.5
with:
title: changesets for branch `dev`
version: yarn changeset-version
publish: yarn release
setupGitUser: false
env:
GITHUB_TOKEN: ${{ secrets.NEO4J_TEAM_GRAPHQL_PERSONAL_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
token: ${{ secrets.NEO4J_TEAM_GRAPHQL_PERSONAL_ACCESS_TOKEN }}
- name: Merge into master if publish happens
if: steps.changesets.outputs.published == 'true'
run: |
git merge --no-ff origin/dev --strategy-option theirs
git push
slack-notify:
needs:
- release
if: ${{ needs.release.outputs.published == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJson(needs.release.outputs.published-packages) }}
steps:
- name: Send Slack announcement of release
if: matrix.package.name == '@neo4j/graphql'
uses: slackapi/slack-github-action@v1.24.0
with:
payload: '{"version":"${{ matrix.package.version }}"}'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_RELEASE_ANNOUNCEMENT_WEBHOOK_URL }}