-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c62d5c
commit 0877113
Showing
4 changed files
with
127 additions
and
49 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,29 @@ | ||
name: Build | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
build-on-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
fetch-depth: ${{ github.event.pull_request.commits }} | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile |
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,97 @@ | ||
name: Releases | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
|
||
jobs: | ||
merged-pr: | ||
if: github.event.pull_request.merged == true && !contains(github.event.pull_request.title, '[skip ci]') | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Generate GitHub app token | ||
id: generate_app_token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.HYPER_SDK_APP_ID }} | ||
private-key: ${{ secrets.HYPER_SDK_APP_PRIVATE_KEY }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.generate_app_token.outputs.token }} | ||
fetch-depth: ${{ github.event.pull_request.commits }} | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Determine release type | ||
id: determine-release | ||
run: | | ||
shopt -s nocasematch | ||
if [[ "${{ github.event.pull_request.title }}" =~ (\[breaking\]|\[major\]) ]]; then | ||
echo "release_type=major" >> $GITHUB_OUTPUT | ||
elif [[ "${{ github.event.pull_request.title }}" =~ \[minor\] ]]; then | ||
echo "release_type=minor" >> $GITHUB_OUTPUT | ||
else | ||
echo "release_type=patch" >> $GITHUB_OUTPUT | ||
fi | ||
shopt -u nocasematch | ||
shell: bash | ||
|
||
- name: Conventional Changelog Action | ||
id: changelog | ||
uses: TriPSs/[email protected] | ||
with: | ||
github-token: ${{ steps.generate_app_token.outputs.token }} | ||
release-count: 0 | ||
skip-version-file: "true" | ||
skip-commit: "true" | ||
git-push: "false" | ||
skip-tag: "true" | ||
skip-bump: "true" | ||
output-file: "false" | ||
|
||
- name: Stash changes | ||
run: git reset --hard | ||
|
||
- name: git config | ||
run: | | ||
git config --local user.name 'hyper-sdk-app[bot]' | ||
git config --local user.email '163947841+hyper-sdk-app[bot]@users.noreply.github.com' | ||
- name: Run standard version | ||
id: standard-version | ||
run: | | ||
npx standard-version --release-as ${{ steps.determine-release.outputs.release_type }} | ||
echo "tag_name=$(git describe --abbrev=0 --tags)" >>$GITHUB_OUTPUT | ||
- name: Push tags and changelog | ||
run: git push --follow-tags origin main | ||
env: | ||
GH_TOKEN: ${{ steps.generate_app_token.outputs.token }} | ||
|
||
- name: create release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ steps.generate_app_token.outputs.token }} | ||
with: | ||
tag_name: "${{ steps.standard-version.outputs.tag_name }}" | ||
release_name: "${{ steps.standard-version.outputs.tag_name }}" | ||
body: "${{ steps.changelog.outputs.clean_changelog }}" | ||
|
||
- name: Publish package on NPM 📦 | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} |
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 |
---|---|---|
|
@@ -84,7 +84,7 @@ | |
"engines": { | ||
"node": ">= 16.0.0" | ||
}, | ||
"packageManager": "^[email protected]", | ||
"packageManager": "[email protected]", | ||
"jest": { | ||
"preset": "react-native", | ||
"modulePathIgnorePatterns": [ | ||
|