-
Notifications
You must be signed in to change notification settings - Fork 156
chore(cicd): Add release workflow #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
64dc71c
Add release step
0dae809
chore(cicd): Add package and github release
cc259d1
chore(cicd): set npm publish
flochaz 0b21273
test(cicd): Fix/release (#321)
flochaz 9df4493
fix(cicd): Fix/release (#323)
flochaz 9a7c850
chore(cicd): fix release
flochaz 87cbf3c
v0.1.0-beta.7
flochaz 3eaabd2
chore(cicd): fix scope
flochaz 534ee8d
Merge branch 'chore/releaseFlow' of github.com:awslabs/aws-lambda-pow…
flochaz e862eec
v0.1.0-beta.8
flochaz 0427ec3
fix test branch
flochaz 819098b
fix(metrics): lib entrypoint
flochaz b8d1881
v0.1.0-beta.9
flochaz b1e8027
fix release target branch
flochaz 8c6296f
Merge branch 'chore/releaseFlow' of github.com:awslabs/aws-lambda-pow…
flochaz 6896076
Merge remote-tracking branch 'origin/main' into chore/releaseFlow
flochaz a497b2c
fix package-lock
flochaz 265fe3d
reset versions for real release
flochaz 1112f6d
fix missing deps
flochaz 0dd05ed
fix old ref to personal org
flochaz d2805e6
Merge remote-tracking branch 'origin/main' into chore/releaseFlow
flochaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,21 +1,62 @@ | ||
name: on-release-event | ||
|
||
name: release | ||
on: | ||
release: | ||
types: [created] | ||
|
||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: {} | ||
jobs: | ||
build: | ||
publish: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Use NodeJS 14" | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install packages | ||
run: | | ||
npm ci | ||
npm run lerna-ci | ||
|
||
- name: "Setup npm" | ||
run: | | ||
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" | ||
|
||
- name: "Version and publish" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor}}@users.noreply.github.com" | ||
|
||
if [ ${{ github.base_ref }} = main ]; then | ||
npx lerna version --conventional-commits --create-release github --yes | ||
else | ||
npx lerna version --conventional-commits --conventional-prerelease --preid beta --create-release github --yes | ||
fi | ||
|
||
npx lerna publish --no-verify-access from-git --yes | ||
|
||
slack: | ||
name: Publish to slack channel | ||
needs: | ||
- publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install packages | ||
- name: publish latest release | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
run: | | ||
export NODE_ENV=dev | ||
npm ci | ||
npm run lerna-ci | ||
- name: Run lint | ||
run: npm run lerna-lint | ||
- name: Run tests | ||
run: npm run lerna-test | ||
# TODO: add publish step | ||
curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{ github.repository }}/releases/latest > release.json | ||
VERSION=$( jq -r '.name' release.json ) | ||
CONTENT=$( jq -r '.body' release.json ) | ||
jq -n --arg version "$VERSION" --arg content "$CONTENT" '{"release-version": $version, "release-content": $content}' > body.json | ||
curl --location --request POST $SLACK_WEBHOOK_URL \ | ||
--header 'Content-Type: application/json' --data @body.json |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.