-
Notifications
You must be signed in to change notification settings - Fork 60
Add GH actions support #7
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
d8b9e83
Add first CHANGELOG entry
fbenevides 221ed1e
Add check release tag task
fbenevides c773dab
Bump beta version
fbenevides ac7fe99
Add create-release task (draft & prerelease)
fbenevides a4c508c
Fix prepare relase task
fbenevides eba6ef8
Identify this release as prerelease but not a draft
fbenevides cca8021
Start using Pusher release standard
fbenevides 87e1ab3
Test bumping version
fbenevides 9035a86
Fix set-release-type task
fbenevides 3ccd97c
Fix release type
fbenevides 0f3e196
Fix npm step
fbenevides 516b804
Fix RELEASE var
fbenevides 84267f2
Fix Beta release variable
fbenevides c449c5f
Test action by pushing to this branch
fbenevides d8b6636
Fix checkout task
fbenevides fcaf624
Just test
fbenevides f0f768d
Fix testing
fbenevides 7431289
Testing release type
fbenevides f9c905d
Fix beta release name
fbenevides 966e19b
Fix PR branch
fbenevides 299d9d0
First version of CI
fbenevides 35598c3
Add build step to release
fbenevides 1c9fcf7
Declare yarn dependencies
fbenevides 104381c
Add pre release step
fbenevides 39cb5e7
Add publish task (with dry-run=true)
fbenevides 22140e7
Enable continue-on-error
fbenevides 1a05dd1
Testing publish
fbenevides ccac84c
Run CI
fbenevides 4780e92
Using NPM instead of Yarn
fbenevides 3a4a647
Remove whitespace
fbenevides b205157
Run CD
fbenevides 7e2757a
Run GHA
fbenevides e4f86ba
First version
fbenevides 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 hidden or 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,60 @@ | ||
on: | ||
pull_request: | ||
types: [ labeled ] | ||
|
||
jobs: | ||
set-release-type: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set major release | ||
if: ${{ github.event.label.name == 'release-major' }} | ||
run: echo "RELEASE=\"major\"" >> $GITHUB_ENV | ||
- name: Set minor release | ||
if: ${{ github.event.label.name == 'release-minor' }} | ||
run: echo "RELEASE=\"minor\"" >> $GITHUB_ENV | ||
- name: Set patch release | ||
if: ${{ github.event.label.name == 'release-patch' }} | ||
run: echo "RELEASE=\"patch\"" >> $GITHUB_ENV | ||
- name: Set beta release | ||
if: ${{ github.event.label.name == 'release-beta' }} | ||
run: echo "RELEASE=\"prerel beta\"" >> $GITHUB_ENV | ||
- name: Check release env | ||
id: check-release-env | ||
run: | | ||
if [[ -z ${{ env.RELEASE }} ]]; | ||
then | ||
echo "You need to set a release label on PRs to the main branch" | ||
exit 1 | ||
else | ||
exit 0 | ||
fi | ||
- name: Setup git | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Pusher CI" | ||
git fetch | ||
git checkout ${{ github.event.pull_request.head.ref }} | ||
- name: Install semver-tool | ||
run: | | ||
export DIR=$(mktemp -d) | ||
cd $DIR | ||
curl https://github.com/fsaintjacques/semver-tool/archive/3.2.0.tar.gz -L -o semver.tar.gz | ||
tar -xvf semver.tar.gz | ||
sudo cp semver-tool-3.2.0/src/semver /usr/local/bin | ||
- name: Set the new version | ||
run: | | ||
export CURRENT_VERSION=$(jq -r '.version' package.json) | ||
export NEW_VERSION=$(semver bump ${{ env.RELEASE }} $CURRENT_VERSION) | ||
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV | ||
|
||
- name: Bump version | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
- run: npm version --git-tag-version=false ${{ env.VERSION }} | ||
- name: Commit changes | ||
run: | | ||
git add package.json | ||
git commit -m "Bump to version ${{ env.VERSION }}" | ||
- name: Push | ||
run: git push |
This file contains hidden or 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,5 @@ | ||
# Changelog | ||
|
||
## 1.0.0-beta.0 | ||
|
||
* [ADDED] First beta release 🥳 |
This file contains hidden or 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
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.
in CHANGELOG.md there's 1.0.0-beta.0 is this correct?
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.
Just for testing :) I'll change that after the CI is working