Skip to content

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 33 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
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 Jun 29, 2022
221ed1e
Add check release tag task
fbenevides Jun 29, 2022
c773dab
Bump beta version
fbenevides Jun 29, 2022
ac7fe99
Add create-release task (draft & prerelease)
fbenevides Jun 29, 2022
a4c508c
Fix prepare relase task
fbenevides Jun 29, 2022
eba6ef8
Identify this release as prerelease but not a draft
fbenevides Jun 29, 2022
cca8021
Start using Pusher release standard
fbenevides Jun 29, 2022
87e1ab3
Test bumping version
fbenevides Jun 29, 2022
9035a86
Fix set-release-type task
fbenevides Jun 29, 2022
3ccd97c
Fix release type
fbenevides Jun 29, 2022
0f3e196
Fix npm step
fbenevides Jun 29, 2022
516b804
Fix RELEASE var
fbenevides Jun 29, 2022
84267f2
Fix Beta release variable
fbenevides Jun 29, 2022
c449c5f
Test action by pushing to this branch
fbenevides Jun 29, 2022
d8b6636
Fix checkout task
fbenevides Jun 29, 2022
fcaf624
Just test
fbenevides Jun 29, 2022
f0f768d
Fix testing
fbenevides Jun 29, 2022
7431289
Testing release type
fbenevides Jun 29, 2022
f9c905d
Fix beta release name
fbenevides Jun 29, 2022
966e19b
Fix PR branch
fbenevides Jun 29, 2022
299d9d0
First version of CI
fbenevides Jun 29, 2022
35598c3
Add build step to release
fbenevides Jun 29, 2022
1c9fcf7
Declare yarn dependencies
fbenevides Jun 29, 2022
104381c
Add pre release step
fbenevides Jun 29, 2022
39cb5e7
Add publish task (with dry-run=true)
fbenevides Jun 29, 2022
22140e7
Enable continue-on-error
fbenevides Jun 29, 2022
1a05dd1
Testing publish
fbenevides Jun 29, 2022
ccac84c
Run CI
fbenevides Jun 29, 2022
4780e92
Using NPM instead of Yarn
fbenevides Jun 29, 2022
3a4a647
Remove whitespace
fbenevides Jun 29, 2022
b205157
Run CD
fbenevides Jun 29, 2022
7e2757a
Run GHA
fbenevides Jun 29, 2022
e4f86ba
First version
fbenevides Jun 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 1.0.0-beta.0

* [ADDED] First beta release 🥳
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pusher-websocket-react-native",
"version": "0.1.0",
"version": "0.0.1",
Copy link
Contributor

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?

Copy link
Contributor Author

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

"description": "Pusher Channels Client for React Native",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down