Skip to content

Commit

Permalink
Merge pull request #5977 from MacondoExpress/backport-changeset-workflow
Browse files Browse the repository at this point in the history
Backport changeset workflow
  • Loading branch information
MacondoExpress authored Jan 29, 2025
2 parents 07cfe7d + 5e882a0 commit e38a97e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 185 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/changesets-4.0.0.yml

This file was deleted.

100 changes: 0 additions & 100 deletions .github/workflows/changesets-master.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: changesets (dev)
name: changesets

on:
push:
branches:
- dev
- lts
- '*.*.*'
- '*.x'

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand All @@ -22,13 +25,13 @@ jobs:

steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
with:
node-version: lts/*

Expand All @@ -51,28 +54,17 @@ jobs:

- name: Create release PR or release
id: changesets
uses: changesets/action@f13b1baaa620fde937751f5d2c3572b9da32af23 # v1.4.5
uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9
with:
title: changesets for branch `dev`
title: changesets for branch `${{ github.ref_name }}`
version: yarn changeset-version
publish: yarn release
publish: yarn ${{ github.ref_name == 'lts' && 'release-lts' || '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
BRANCH: ${{ github.ref_name }}

slack-notify:
needs:
Expand All @@ -88,7 +80,7 @@ jobs:
steps:
- name: Send Slack announcement of release
if: matrix.package.name == '@neo4j/graphql'
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
with:
payload: '{"version":"${{ matrix.package.version }}"}'
env:
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
"test:pr": "run-s lint test",
"test-docker": "docker-compose up --build --abort-on-container-exit",
"prepare": "husky install",
"changeset-version": "changeset version && yarn",
"changeset-version-4.0.0": "changeset version --since 4.0.0 && yarn",
"changeset-version-master": "changeset version --since master && yarn",
"changeset-version": "changeset version --since $BRANCH && yarn",
"release": "yarn build && changeset publish"
},
"devDependencies": {
Expand Down

0 comments on commit e38a97e

Please sign in to comment.