forked from polkadot-js/extension
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c98ae21
commit 0640c56
Showing
2 changed files
with
67 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,64 @@ | ||
name: Release Pipeline (develop/2.0) | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
types: | ||
- labeled | ||
check_suite: | ||
types: | ||
- completed | ||
|
||
jobs: | ||
merge-release-branch: | ||
# only run if prechecks pass and the source branch is named 'prerelease/*' | ||
if: ${{ startsWith(github.head_ref, 'prerelease/2') }} && ${{ github.event.label.name == 'automerge' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Automerge | ||
uses: "pascalgn/[email protected]" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
MERGE_LABELS: automerge | ||
MERGE_METHOD: squash | ||
release-to-github: | ||
needs: | ||
- merge-release-branch | ||
# release to github only when its a prerelease branch and auto merge label is triggered | ||
if: ${{ startsWith(github.head_ref, 'prerelease/2') }} && ${{ github.event.label.name == 'automerge' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
# checkout merged branch | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '15.3' | ||
- name: find release version | ||
id: find_version | ||
run: | | ||
echo ::set-output name=tag_name::$(cat packages/api/package.json \ | ||
| grep version \ | ||
| head -1 \ | ||
| grep -E -o '[0-9|.]+\-*[a-z]*\.[0-9]+|]+') | ||
- name: make release branch | ||
uses: peterjgrainger/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
branch: "release/${{steps.find_version.outputs.tag_name}}" | ||
- name: package | ||
run: | | ||
yarn && yarn build | ||
npx lerna exec -- 'cp package.json build/' | ||
npx lerna exec -- 'cp README.md build/' | ||
npx lerna exec -- 'cp ../../LICENSE build/' | ||
- name: publish to npm | ||
env: | ||
NPM_KEY: ${{ secrets.NPM_KEY }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${NPM_KEY}" > ~/.npmrc | ||
echo 'Publishing to npmjs.org.' | ||
npx lerna exec -- 'cd build && npm publish --access public' |
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