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

Migrate to semantic release #2298

Merged
merged 6 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 2 additions & 48 deletions .github/workflows/build-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ jobs:
with:
submodules: recursive

- name: Setup Git identity
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

- name: Setup Nodejs and npm
uses: actions/setup-node@v2
with:
Expand Down Expand Up @@ -58,51 +53,10 @@ jobs:
working-directory: package
run: |
yarn build
yarn release

- name: Create New Branch
run: |
git checkout -b release-$GITHUB_RUN_ID
git push origin release-$GITHUB_RUN_ID

- name: Create Pull Request using GitHub CLI
run: |
gh auth setup-git
TITLE="Release ${{ steps.get_npm_package_version.outputs.npm_package_version }}"
BODY="update changelog"
gh pr create --base main --head ${{ env.NEW_BRANCH }} --title "$TITLE" --body "$BODY"
npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true

- name: Get NPM Package name
id: get_npm_package_name
run: echo "npm_package_name=$(yarn get-filename-npm| grep ^'shopify')" >> "$GITHUB_OUTPUT"

- name: Upload artifacts - NPM Package
uses: actions/upload-artifact@v2
with:
name: ${{steps.get_npm_package_name.outputs.npm_package_name}}
path: ${{ env.WORKING_DIRECTORY }}/dist/${{steps.get_npm_package_name.outputs.npm_package_name}}

- name: Get NPM Package version
id: get_npm_package_version
run: echo "npm_package_version=$(yarn get-version-npm| tail -2| head -1)" >> "$GITHUB_OUTPUT"

- name: Publish to NPM
uses: JS-DevTools/npm-publish@v1
with:
package: ./package/package.json
token: ${{ secrets.NPM_TOKEN }}

- name: Create Github Release
uses: ncipollo/release-action@v1
with:
tag: "v${{steps.get_npm_package_version.outputs.npm_package_version}}"
name: "Release ${{steps.get_npm_package_version.outputs.npm_package_version}}"
generateReleaseNotes: true
replacesArtifacts: false
token: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Install & Build Docs
run: cd package; yarn; cd ../docs; yarn; yarn build;
Expand Down
16 changes: 16 additions & 0 deletions package/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": true
}
],
[
"@semantic-release/github"
]
]
}
14 changes: 0 additions & 14 deletions package/CHANGELOG.md

This file was deleted.

5 changes: 2 additions & 3 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"setup-skia-web": "./scripts/setup-canvaskit.js"
},
"title": "React Native Skia",
"version": "1.0.3",
"version": "0.0.0-development",
"description": "High-performance React Native Graphics using Skia",
"main": "lib/module/index.js",
"react-native": "src/index.ts",
Expand Down Expand Up @@ -49,7 +49,7 @@
"test": "jest",
"e2e": "E2E=true yarn test -i e2e",
"build": "bob build && merge-dirs lib/typescript/src lib/commonjs && merge-dirs lib/typescript/src lib/module",
"release": "standard-version"
"release": "semantic-release"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -106,7 +106,6 @@
"react-native": "0.72.6",
"react-native-builder-bob": "0.18.2",
"react-native-reanimated": "3.6.2",
"standard-version": "^9.5.0",
"ts-jest": "29.1.1",
"typescript": "5.1.6",
"ws": "8.11.0"
Expand Down
Loading
Loading