-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): setup workflow for release process
- Loading branch information
1 parent
b24abb8
commit bb9590f
Showing
5 changed files
with
114 additions
and
0 deletions.
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,12 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
"packages": { | ||
".": { | ||
"changelog-path": "CHANGELOG.md", | ||
"release-type": "node", | ||
"bump-minor-pre-major": true, | ||
"bump-patch-for-minor-pre-major": true, | ||
"draft": false | ||
} | ||
} | ||
} |
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,3 @@ | ||
{ | ||
".": "0.0.1" | ||
} |
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,16 @@ | ||
name: commit-message-lint | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
commitlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: wagoid/commitlint-github-action@v5 |
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,75 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
outputs: | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
tag_name: ${{ steps.release.outputs.tag_name }} | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
command: manifest | ||
config-file: .github/release-please-config.json | ||
manifest-file: .github/release-please-manifest.json | ||
- uses: actions/checkout@v3 | ||
- name: Add files and publish release | ||
if: ${{ steps.release.outputs.release_created }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
TAG_NAME: ${{ steps.release.outputs.tag_name }} | ||
run: | | ||
npm ci | ||
npm run package | ||
mv wit-idl.vsix ${TAG_NAME}.vsix | ||
gh release upload ${TAG_NAME} ${TAG_NAME}.vsix | ||
label: | ||
needs: [publish] | ||
if: ${{ needs.publish.outputs.release_created }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
repository-projects: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Add label to PR | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
PR_NUMBER=$(gh pr list --state merged --label 'autorelease: tagged' --json number --jq '.[0].number') | ||
gh pr edit ${PR_NUMBER} --add-label 'autorelease: published' | ||
comments: | ||
needs: [publish] | ||
if: ${{ needs.publish.outputs.release_created }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: apexskier/github-release-commenter@v1 | ||
with: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
comment-template: | | ||
:tada: This change has been included in ${{ needs.publish.outputs.tag_name }} :tada: | ||
The release is available on: | ||
- GitHub releases: {release_link} | ||
Your **[release-please](https://github.com/googleapis/release-please)** bot :rocket::pray: |
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,8 @@ | ||
module.exports = { | ||
extends: ["@commitlint/config-conventional"], | ||
rules: { | ||
"type-enum": [2, "always", ["build", "chore", "docs", "feat", "fix", "refactor", "style", "test"]], | ||
"body-max-line-length": [0, "always"], | ||
"footer-max-line-length": [0, "always"], | ||
}, | ||
}; |