This repository has been archived by the owner on Apr 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use github workflow to create the tag when use the `npm run release -- major|minor|patch` command * Use automation to create the draft release related with this tag * Create or update the global tag (major version) when the release was published Co-authored-by: alexesprit <[email protected]>
- Loading branch information
1 parent
3fb9e44
commit 3589118
Showing
10 changed files
with
143 additions
and
113 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,23 @@ | ||
name-template: 'Release v$NEXT_PATCH_VERSION' | ||
tag-template: 'v$NEXT_PATCH_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- title: '🧰 Maintenance' | ||
label: 'maintenance' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
template: | | ||
## Changes | ||
$CHANGES | ||
## Contributors | ||
$CONTRIBUTORS | ||
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,47 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- id: draft_release | ||
name: Draft Release | ||
uses: toolmantim/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Change tag | ||
env: | ||
GITHUB_USER: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo "Get the release name" | ||
output=${{ steps.draft_release.outputs.html_url }} | ||
output=$(hub release -d -f "%T;%U%n" | grep "${output}" | cut -d';' -f1) | ||
echo "${output}" | ||
echo "Get the package.json version" | ||
version=$(cat package.json | jq '.version') | ||
version=${version//\"} | ||
echo "${version}" | ||
echo "Edit the version in the release" | ||
hub release edit -m "v${version} 🌈" "${output}" | ||
echo "v${version} 🌈" | ||
echo "Get the new release tag" | ||
output=$(hub release -d -f "%T;%t%n" | grep "v${version}" | head -n1 | cut -d';' -f 1) | ||
echo "${output}" | ||
echo "Change the release tag to: v${version}" | ||
content="$(hub release show "${output}")" | ||
hub release delete "${output}" | ||
hub release create --draft=true -m "${content}" "v${version}" | ||
hub release -d |
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,26 @@ | ||
name: Link tags | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
name: Link latest full tag to latest patch | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- run: | | ||
# Extract the tag of the release | ||
LATEST_TAG=${GITHUB_REF##*/} | ||
# Get the patch version of the tag | ||
tag=$(echo "${LATEST_TAG%.*.*}") | ||
# Create git identity | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "BOT_WORKFLOW" | ||
# Use -f to update the current tag version or create a new | ||
git push --delete origin ${tag} 2> /dev/null | true | ||
git tag -f -m "🔖 Release ${tag}" -a ${tag} | ||
git push --tags |
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,29 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'dist/**.js' | ||
pull_request: | ||
paths: | ||
- 'dist/**.js' | ||
|
||
jobs: | ||
test-ubuntu: | ||
name: Run tests on ${{ matrix.os }} ${{ matrix.v-version }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
v-version: [latest, master, 0.1.27] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up V version latest | ||
uses: ./ | ||
with: | ||
v-version: ${{ matrix.v-version }} | ||
id: v | ||
|
||
- name: Test V is present | ||
run: v version |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
message=":bookmark: Release v%s" |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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