-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adding common release pipeline #69
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4a900b8
Removing unused dependency
CarlosGamero c2be5cb
api-common package-version script
CarlosGamero 7a8ccb0
Adding api-common release pipeline
CarlosGamero 270e4fb
Fixing lint
CarlosGamero 2dae95d
Revert "Fixing lint"
CarlosGamero c316873
Merge branch 'main' into api-common_release_pipeline
CarlosGamero 0f9e3f4
Adding missing build step
CarlosGamero 9f0b8f3
Including common release pipeline
CarlosGamero c59428e
Websockets-common release pipeline
CarlosGamero d79877a
Merge branch 'main' into feature/adding_common_release_pipeline
CarlosGamero c57e879
Merge branch 'main' into feature/adding_common_release_pipeline
CarlosGamero f4a5369
Fixing issues on common release pipeline
CarlosGamero 5c314f3
Minor issue fix
CarlosGamero facc00a
Merge branch 'main' into feature/adding_common_release_pipeline
CarlosGamero 76055e1
websocket-common dependency change to test release
CarlosGamero 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 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,67 @@ | ||
name: Package release to NPM | ||
on: | ||
workflow_call: | ||
inputs: | ||
working_directory: | ||
required: true | ||
type: string | ||
package_name: | ||
required: true | ||
type: string | ||
secrets: | ||
npm_token: | ||
required: true | ||
|
||
jobs: | ||
release: | ||
# Only run for pull requests that has been merged (not closed) and that doesn't have `skip-release` label | ||
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'skip-release') == false | ||
name: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
scope: '@lokalise' | ||
always-auth: true | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
working-directory: ${{ inputs.working_directory }} | ||
|
||
- name: Build Package | ||
run: npm run build | ||
working-directory: ${{ inputs.working_directory }} | ||
|
||
- name: Setup git config | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "AUTO RELEASE" | ||
|
||
# Apply proper semver according to GitHub labels | ||
- name: Major label detected | ||
if: contains(github.event.pull_request.labels.*.name, 'major') | ||
run: npm version major | ||
working-directory: ${{ inputs.working_directory }} | ||
- name: Minor label detected | ||
if: contains(github.event.pull_request.labels.*.name, 'minor') | ||
run: npm version minor | ||
working-directory: ${{ inputs.working_directory }} | ||
- name: Patch label detected | ||
if: contains(github.event.pull_request.labels.*.name, 'patch') | ||
run: npm version patch | ||
working-directory: ${{ inputs.working_directory }} | ||
|
||
- name: Git push | ||
run: COMMIT_MSG=$(npm run --silent package-version --workspace=${{ inputs.working_directory }}) && git commit -am "${{ inputs.package_name }} $COMMIT_MSG" && git push origin main | ||
|
||
- name: Release Package | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.npm_token }} | ||
run: npm publish | ||
working-directory: ${{ inputs.working_directory }} |
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,18 @@ | ||
name: Package release to NPM -> websockets-common | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
paths: | ||
- 'packages/app/websockets-common/**' | ||
|
||
jobs: | ||
call-build-flow: | ||
uses: lokalise/shared-ts-libs/.github/workflows/release.package.yml@main | ||
with: | ||
working_directory: 'packages/app/websockets-common' | ||
package_name: 'websockets-common' | ||
secrets: | ||
npm_token: ${{ secrets.NPM_TOKEN }} |
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
Oops, something went wrong.
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.
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.
If it works, I will update
api-common
release and add the pipeline for all the other packages