-
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): set a seperate publish workflow for v1 (#1694)
- Loading branch information
Showing
2 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: publish | ||
|
||
on: | ||
workflow_run: | ||
workflows: [ci] | ||
branches: [v1-hotfix] | ||
types: [completed] | ||
|
||
env: | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
|
||
jobs: | ||
# Publish the public packages to npm | ||
npm: | ||
if: github.event.workflow_run.conclusion == 'success' | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout code repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: 'origin/v1-hotfix' | ||
|
||
- name: setup caching | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.PNPM_CACHE_FOLDER }} | ||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm- | ||
- name: setup node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
|
||
- name: install and audit | ||
uses: ./support/actions/pnpm | ||
with: | ||
cache: ${{ env.PNPM_CACHE_FOLDER }} | ||
|
||
- name: build project | ||
run: pnpm build | ||
|
||
- name: publish npm release | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > $HOME/.npmrc | ||
pnpm release | ||
rm $HOME/.npmrc | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: parse changelog for @remirror/react | ||
id: changelog_remirror_react | ||
uses: ocavue/changelog-parser-action@v1 | ||
with: | ||
filePath: 'packages/remirror__react/CHANGELOG.md' | ||
|
||
- name: create release for @remirror/react | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
commit: v1-hotfix | ||
tag: '@remirror/react@${{ fromJSON(steps.changelog_remirror_react.outputs.parsed).versions[0].version }}' | ||
body: '${{ fromJSON(steps.changelog_remirror_react.outputs.parsed).versions[0].body }}' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
continue-on-error: true | ||
|
||
- name: parse changelog for @remirror/pm | ||
id: changelog_remirror_pm | ||
uses: ocavue/changelog-parser-action@v1 | ||
with: | ||
filePath: 'packages/remirror__pm/CHANGELOG.md' | ||
|
||
- name: create release for @remirror/pm | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
commit: v1-hotfix | ||
tag: '@remirror/pm@${{ fromJSON(steps.changelog_remirror_pm.outputs.parsed).versions[0].version }}' | ||
body: '${{ fromJSON(steps.changelog_remirror_pm.outputs.parsed).versions[0].body }}' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
continue-on-error: true | ||
|
||
# make sure that `remirror` is the last one so that it can at the top of the release list | ||
- name: parse changelog for remirror | ||
id: changelog_remirror | ||
uses: ocavue/changelog-parser-action@v1 | ||
with: | ||
filePath: 'packages/remirror/CHANGELOG.md' | ||
|
||
- name: create release for remirror | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
commit: v1-hotfix | ||
tag: 'remirror@${{ fromJSON(steps.changelog_remirror.outputs.parsed).versions[0].version }}' | ||
body: '${{ fromJSON(steps.changelog_remirror.outputs.parsed).versions[0].body }}' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
continue-on-error: true |
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