-
Notifications
You must be signed in to change notification settings - Fork 153
chore(cicd): Create release workflow following #366 discussion proposal 1 #369
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
Conversation
…a-powertools-typescript into feat/cicd/prodWorkflow
…a-powertools-typescript into feat/cicd/prodWorkflow
This reverts commit 9b3fb52.
0852a72
to
5a91078
Compare
c2f6170
to
a69f6ce
Compare
npx lerna version --conventional-commits --conventional-prerelease --preid beta --force-publish=* --yes --no-changelog | ||
git push --delete origin $(git describe --abbrev=0) | ||
|
||
npx lerna publish from-package --no-verify-access --yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not publish to npm for intermediary version
npx lerna publish from-package --no-verify-access --yes |
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/$GITHUB_REPOSITORY | ||
|
||
# Follow https://github.com/lerna/lerna/issues/2248#issuecomment-527882069 recommendation | ||
npx lerna version --conventional-commits --conventional-prerelease --preid beta --force-publish=* --yes --no-changelog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npx lerna version --conventional-commits --conventional-prerelease --preid beta --force-publish=* --yes --no-changelog | |
npx lerna version --conventional-commits --conventional-prerelease --preid dev --force-publish=* --yes --no-changelog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want changelog but populating unreleased section
else | ||
npx lerna version --conventional-commits --conventional-prerelease --preid beta --create-release github --force-publish=* --yes | ||
fi | ||
npx lerna version --conventional-commits --conventional-graduate --create-release github --force-publish=* --yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npx lerna version --conventional-commits --conventional-graduate --create-release github --force-publish=* --yes | |
npx lerna version --conventional-commits --conventional-graduate --preid beta --create-release github --force-publish=* --yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to test preid on graduate
on: | ||
push: | ||
branches: | ||
- main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be renamed to on-release-dev.yml
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, describing the trigger event: "on-merge-to-main"
VERSION="${{ env.RELEASE_VERSION }}" | ||
ALIAS="latest" | ||
echo "Publishing doc for version: $VERSION" | ||
mkdocs build | ||
mike deploy --push --update-aliases "$VERSION" "$ALIAS" | ||
# Set latest version as a default | ||
mike set-default --push latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to publish tomain
.
VERSION="${{ env.RELEASE_VERSION }}" | |
ALIAS="latest" | |
echo "Publishing doc for version: $VERSION" | |
mkdocs build | |
mike deploy --push --update-aliases "$VERSION" "$ALIAS" | |
# Set latest version as a default | |
mike set-default --push latest | |
VERSION="main" | |
ALIAS="latest" | |
echo "Publishing doc for version: $VERSION" | |
mkdocs build | |
mike deploy --push --update-aliases "$VERSION" "$ALIAS" |
- name: Set RELEASE_VERSION env var | ||
run: | | ||
RELEASE_VERSION=$(cat packages/commons/package.json | jq '.version' -r) | ||
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in discussion, let's only publish the new version when we do full release. For this one, we can just put this in main
. Thus, we don't need this version number.
- name: Set RELEASE_VERSION env var | |
run: | | |
RELEASE_VERSION=$(cat packages/commons/package.json | jq '.version' -r) | |
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 yep, as agreed during the meeting, in the "merge-to-main" process we will not publish to NPM and not create a github release
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./api | ||
keep_files: true | ||
destination_dir: ${{ env.RELEASE_VERSION }}/api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll copy the API to main/api
destination_dir: ${{ env.RELEASE_VERSION }}/api | |
destination_dir: main/api |
- name: Release API docs to the "latest" version | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./api | ||
keep_files: true | ||
destination_dir: latest/api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this as we don't need to copy API doc to any other folder beside main
(done in the last step)
- name: Release API docs to the "latest" version | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./api | |
keep_files: true | |
destination_dir: latest/api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. I have just one question.
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/$GITHUB_REPOSITORY | ||
|
||
# Follow https://github.com/lerna/lerna/issues/2248#issuecomment-527882069 recommendation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(minor) The summary of issue you are trying to solve will be nice here.
By "recommendation", do you mean adding the --no-changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to have - can we incorporate this workflow: https://github.com/awslabs/aws-lambda-powertools-typescript/blob/d8fd2c1f74501ce5558057171742bd0eafdc55de/.github/workflows/release-drafter.yml
in your on-merge-to-main file here?
I know why they were implemented separated, but in my mind they are triggered by the same event and are part of the same workflow.
…a-powertools-typescript into feat/cicd/prodWorkflow
Description of your changes
Implement #366 proposal 1:
Pre release
0.2.0-dev.10
)dev
(see https://awslabs.github.io/aws-lambda-powertools-typescript/dev/)Release
trigger: manually
Github commit:
0.3.0
0.3.0
Github release: created (
0.3.0
) and same data as changelognpm: published (
0.3.0
)Doc: published under (
0.3.0
)Tests
Pre-release tested on a modified trigger:
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.