2023-02-21 05:04:35 -08:00
|
|
|
name: 'Release: Publish'
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types:
|
|
|
|
- closed
|
|
|
|
branches:
|
2023-06-27 07:15:29 -07:00
|
|
|
- 'release/*'
|
2023-02-21 05:04:35 -08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-release:
|
|
|
|
if: github.event.pull_request.merged == true
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2023-04-24 07:08:20 -07:00
|
|
|
timeout-minutes: 60
|
2023-02-21 05:04:35 -08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: actions/checkout@v4.1.1
|
2023-02-21 05:04:35 -08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2024-02-02 00:47:58 -08:00
|
|
|
- run: corepack enable
|
2024-01-26 02:26:30 -08:00
|
|
|
- uses: actions/setup-node@v4.0.1
|
2023-02-21 05:04:35 -08:00
|
|
|
with:
|
2023-06-02 06:23:28 -07:00
|
|
|
node-version: 18.x
|
2023-02-21 05:04:35 -08:00
|
|
|
cache: 'pnpm'
|
|
|
|
- run: pnpm install --frozen-lockfile
|
|
|
|
|
2023-04-05 08:14:41 -07:00
|
|
|
- name: Set release version in env
|
|
|
|
run: echo "RELEASE=$(node -e 'console.log(require("./package.json").version)')" >> $GITHUB_ENV
|
|
|
|
|
2023-02-21 05:04:35 -08:00
|
|
|
- name: Build
|
|
|
|
run: pnpm build
|
|
|
|
|
2023-11-29 03:03:19 -08:00
|
|
|
- name: Dry-run publishing
|
|
|
|
run: pnpm publish -r --no-git-checks --dry-run
|
|
|
|
|
2023-02-21 05:04:35 -08:00
|
|
|
- name: Publish to NPM
|
|
|
|
run: |
|
|
|
|
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
|
2023-08-31 05:05:12 -07:00
|
|
|
node scripts/trim-fe-packageJson.js
|
2023-10-09 09:12:48 -07:00
|
|
|
sed -i "s/default: 'dev'/default: 'stable'/g" packages/cli/dist/config/schema.js
|
2023-08-31 05:05:12 -07:00
|
|
|
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc --no-git-checks
|
2023-04-26 07:08:02 -07:00
|
|
|
npm dist-tag rm n8n rc
|
2023-02-21 05:04:35 -08:00
|
|
|
|
2023-04-26 07:08:02 -07:00
|
|
|
- name: Create a Release on GitHub
|
2023-02-21 05:04:35 -08:00
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
with:
|
|
|
|
commit: ${{github.event.pull_request.base.ref}}
|
|
|
|
tag: 'n8n@${{env.RELEASE}}'
|
2023-04-26 07:08:02 -07:00
|
|
|
prerelease: true
|
|
|
|
makeLatest: false
|
2023-06-27 07:15:29 -07:00
|
|
|
body: ${{github.event.pull_request.body}}
|
2023-04-26 07:08:02 -07:00
|
|
|
|
|
|
|
- name: Trigger a release note
|
|
|
|
continue-on-error: true
|
|
|
|
run: curl -u docsWorkflows:${{ secrets.N8N_WEBHOOK_DOCS_PASSWORD }} --request GET 'https://internal.users.n8n.cloud/webhook/trigger-release-note' --header 'Content-Type:application/json' --data '{"version":"${{env.RELEASE}}"}'
|
2023-02-21 05:04:35 -08:00
|
|
|
|
2023-06-02 05:18:32 -07:00
|
|
|
# - name: Merge Release into 'master'
|
|
|
|
# run: |
|
|
|
|
# git fetch origin
|
|
|
|
# git checkout --track origin/master
|
|
|
|
# git config user.name "Jan Oberhauser"
|
|
|
|
# git config user.email jan.oberhauser@gmail.com
|
|
|
|
# git merge --ff n8n@${{env.RELEASE}}
|
|
|
|
# git push origin master
|
|
|
|
# git push origin :${{github.event.pull_request.base.ref}}
|