Skip to content
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

Fix: release process #27

Merged
merged 14 commits into from
Oct 5, 2022
13 changes: 8 additions & 5 deletions .github/workflows/gitflow-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ on:
options:
- nothing
- major
- premajor
- minor
- preminor
- patch
- prepatch
- prerelease

jobs:
ci-gitflow-display-inputs:
Expand Down Expand Up @@ -65,7 +69,6 @@ jobs:
# fetch-depth: to be able to detect diff between release branch and main branch
fetch-depth: 0
ref: ${{ github.event.ref }}
#token: ${{secrets.GIT_TOKEN}}

- name: setup git config
run: |
Expand All @@ -77,13 +80,13 @@ jobs:
id: release
run: |
echo "Create release from ${{ github.event.ref }} to a new release branch and create tag"
npm version ${{ github.event.inputs.scope }} > release.version
npm version ${{ github.event.inputs.scope }} --no-git-tag-version > release.version
echo "::set-output name=releaseVersion::$(cat release.version)"
echo "::set-output name=releasebranch::release_$(cat release.version)"
git branch release_$(cat release.version)
git checkout release_$(cat release.version)
git add package.json
git commit -m "Prepare release $(cat release.version)"
git commit -m "Release $(cat release.version)"
git push origin release_$(cat release.version)
git tag -a $(cat release.version) -m "Release $(cat release.version)"
git push origin --tags
Expand All @@ -94,6 +97,8 @@ jobs:
uses: Roang-zero1/github-create-release-action@master
with:
created_tag: ${{ steps.release.outputs.releaseVersion }}
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
prerelease_regex: "^v[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+-[[:digit:]]"
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}

Expand All @@ -108,7 +113,6 @@ jobs:
# fetch-depth: to be able to detect diff between release branch and main branch
fetch-depth: 0
ref: main
token: ${{secrets.GIT_TOKEN}}
- name: setup git config
run: |
git config user.name $GITHUB_ACTOR
Expand All @@ -131,7 +135,6 @@ jobs:
# fetch-depth: to be able to detect diff between release branch and main branch
fetch-depth: 0
ref: develop
token: ${{secrets.GIT_TOKEN}}
- name: setup git config
run: |
git config user.name $GITHUB_ACTOR
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# use for release
release.version
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## v1.0.0

First version of the website