-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat(actions): ♻️ rebuild CI build system #61
Closed
Closed
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c3b84a2
chore(release): 1.16.1
yi-Xu-0100 37d80f2
chore(release): 1.16.1
yi-Xu-0100 545dfcd
test: add changelog
yi-Xu-0100 fcd5859
chore(release): 1.16.1
yi-Xu-0100 8b5295e
test: .prettierignore
yi-Xu-0100 eb303a9
chore(release): 1.16.1
yi-Xu-0100 cd5b15c
test: no .prettierignore
yi-Xu-0100 702ce39
chore(release): 1.16.1
yi-Xu-0100 1e8dd5f
fix: add .prettierignore
yi-Xu-0100 b5bbe37
chore(release): 1.16.2
yi-Xu-0100 edd76b4
fix(actions): :green_heart: fix CI build system
yi-Xu-0100 b074bab
chore(gitignore): :rewind: revert the change of .gitignore
yi-Xu-0100 ce3c6f4
fix(actions): :pencil2: fix the remote url
yi-Xu-0100 8e6f0b2
ci(actions): :bug: fix remote not found error
yi-Xu-0100 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 |
---|---|---|
@@ -1,11 +1,7 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- CHANGELOG.md | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
|
@@ -14,8 +10,19 @@ jobs: | |
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup package | ||
run: yarn install | ||
|
||
- name: Get version from package | ||
- name: Bump version | ||
run: | | ||
yarn standard-version --skip.commit --skip.tag | ||
sed 's/^### \[/## [/' -i CHANGELOG.md | ||
yarn prettier --write CHANGELOG.md --prose-wrap never --ignore-path ./gitignore | ||
|
||
- name: Get version from package.json | ||
uses: actions/[email protected] | ||
id: version | ||
with: | ||
|
@@ -24,29 +31,29 @@ jobs: | |
const version = require(`${process.env.GITHUB_WORKSPACE}/package.json`).version; | ||
core.setOutput('repo', context.repo.repo); | ||
core.setOutput('version', version); | ||
const time = new Date(Date.now()).toISOString().slice(0,10); | ||
const titleLink = version.replace(/\./g,'') + '-' + time; | ||
core.setOutput('titleLink', titleLink); | ||
try { | ||
var latestRelease = await github.repos.getLatestRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo | ||
}); | ||
const latestTag = latestRelease.data.tag_name; | ||
core.setOutput('commitLink', `compare/${latestTag}...v${version}`); | ||
} catch (error) { | ||
if (error.message === 'Not Found') { | ||
core.setOutput('commitLink', `commits/v${version}`); | ||
} else { | ||
core.setFailed(error.message); | ||
} | ||
} | ||
return true; | ||
|
||
- name: Generate Package | ||
- name: Push commit | ||
run: | | ||
yarn install | ||
yarn run build | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit -m "chore(release): :bookmark: release v${{steps.version.outputs.version}}" | ||
git push https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${{github.GITHUB_REPOSITORY}}.git | ||
|
||
- name: Publish package | ||
env: | ||
VSCE_PAT: ${{ secrets.VSCE_PAT }} | ||
run: yarn run deploy | ||
|
||
- name: Build release asset | ||
run: yarn run build | ||
|
||
- name: Get Changelog Entry | ||
id: changelog_reader | ||
uses: mindsers/[email protected] | ||
with: | ||
version: ${{steps.version.outputs.version}} | ||
path: ./CHANGELOG.md | ||
|
||
- name: Create release | ||
id: create_release | ||
|
@@ -56,11 +63,10 @@ jobs: | |
with: | ||
tag_name: v${{steps.version.outputs.version}} | ||
release_name: Release v${{steps.version.outputs.version}} | ||
body: | | ||
* Changelogs: | ||
<https://github.com/${{github.repository}}/blob/master/CHANGELOG.md#${{steps.version.outputs.titleLink}}> | ||
* Commits: | ||
<https://github.com/${{github.repository}}/${{steps.version.outputs.commitLink}}> | ||
body: ${{ steps.changelog_reader.outputs.changes }} | ||
prerelease: | ||
${{ steps.changelog_reader.outputs.status == 'prereleased' }} | ||
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} | ||
|
||
- name: Upload release asset | ||
uses: actions/[email protected] | ||
|
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 @@ | ||
CHANGELOG.md | ||
yi-Xu-0100 marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
Better to have a git tag here. Previously
--skip.tag
was used instandard-version
.