Skip to content

Commit

Permalink
ci: add semantic release (#526)
Browse files Browse the repository at this point in the history
* chore: cleanup workspaces

* ci: add semantic-release

* ci: add workflow_call trigger to review

* ci: add provenance to publishConfig

* ci: remove v from tagFormat

* fix: force major release

BREAKING CHANGE: Upgrade native packages and migrate components

* ci: move native builds to review

* ci: run release immediate for debugging

* ci: use android working directory for build

* docs: remove RELEASE.md

* chore: remove manual changelog task

* ci: enable release on beta branch

* ci: keep default tagFormat

* ci: setup npm tag fixes

* ci: run review on mr to beta

* ci: run fix tags on beta

* ci: fix name

* ci: clarify workflow_call

* ci: disable debugging

* ci: run fix tags in pr

* ci: setup fix tags to run on beta

* docs: prepare changelog for semantic-release

* ci: remove fix npm tags workflow
  • Loading branch information
KiwiKilian authored Dec 2, 2024
1 parent ea85130 commit 069b6c5
Show file tree
Hide file tree
Showing 10 changed files with 2,855 additions and 239 deletions.
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Added `your feature` that allows ...
- [ ] I formatted JS and TS files with running `yarn lint:eslint:fix` in the root folder
- [ ] I have run tests via `yarn test` in the root folder
- [ ] I updated the documentation with running `yarn codegen` in the root folder
- [ ] I mentioned this change in `CHANGELOG.md`
- [ ] I added/updated a sample (`/packages/examples`)

## Screenshot OR Video
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/build-react-native-android.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/build-react-native-ios.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
branches:
- main
- beta
- alpha

jobs:
review:
name: Review
uses: ./.github/workflows/review.yml
release:
name: Release
needs: [review]
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Audit Signatures
run: npm audit signatures
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}
run: yarn semantic-release --dry-run
63 changes: 43 additions & 20 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Review

on:
push:
branches:
- main
workflow_call:
# Release calls this Workflow
pull_request:
branches:
- main
- beta
- alpha
merge_group:
types:
- checks_requested
Expand Down Expand Up @@ -89,31 +90,53 @@ jobs:
build-react-native-android:
name: Build React Native Android
needs: [lint-eslint, lint-tsc, test, codegen, build-library]
uses: ./.github/workflows/build-react-native-android.yml
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/react-native-app
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Setup Azul Zulu OpenJDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21

- name: Build Android
run: ./gradlew assemble
working-directory: packages/react-native-app/android

build-react-native-ios:
name: Build React Native iOS & Test with Detox
needs: [lint-eslint, lint-tsc, test, codegen, build-library]
uses: ./.github/workflows/build-react-native-ios.yml

publish:
name: Publish
if: startsWith(github.ref, 'refs/tags/')
needs: [lint-eslint, lint-tsc, test, codegen, build-library, build-react-native-android, build-react-native-ios]
runs-on: ubuntu-latest
runs-on: macos-latest
timeout-minutes: 30
defaults:
run:
working-directory: ./packages/react-native-app
steps:
- name: Checkout code
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
with:
registry-url: https://registry.npmjs.org/

- name: Setup .yarnrc.yml
run: yarn config set npmAuthToken $NPM_AUTH_TOKEN
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}
- name: Install Pod Dependencies
run: cd ios && pod --version && pod install

- name: Install Detox Dependencies
run: |
brew tap wix/brew
brew install applesimutils
yarn detox clean-framework-cache && yarn detox build-framework-cache
- name: Build iOS
run: yarn detox build -c ios.sim.release

- name: Publish
run: yarn npm publish
- name: Test with Detox
run: yarn detox test --debug-synchronization 200 -c ios.sim.release
10 changes: 10 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
]
}
9 changes: 0 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
## UNRELEASED

```
Please add unreleased changes in the following style:
- PR Title ([#___](https://github.com/maplibre/maplibre-react-native/pull/___))
```

- chore: remove created-by headers and update LICENSE/Copyright ([#518](https://github.com/maplibre/maplibre-react-native/pull/518))

## 10.0.0-alpha.29

- ci: fail on lint warning ([#522](https://github.com/maplibre/maplibre-react-native/pull/522))
Expand Down
30 changes: 0 additions & 30 deletions RELEASE.md

This file was deleted.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"description": "React Native library for creating maps with MapLibre Native for Android & iOS",
"version": "10.0.0-alpha.29",
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
},
"author": "MapLibre",
"keywords": [
Expand Down Expand Up @@ -38,7 +39,6 @@
"prepack": "bob build && yarn plugin:build"
},
"workspaces": [
"apps/*",
"packages/*"
],
"packageManager": "[email protected]",
Expand Down Expand Up @@ -147,6 +147,8 @@
"@maplibre/maplibre-gl-style-spec": "21.1.0",
"@react-native/babel-preset": "^0.74.88",
"@react-native/metro-config": "^0.74.88",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@sinonjs/fake-timers": "^11.2.2",
"@testing-library/react-native": "^12.4.3",
"@types/ejs": "^3.1.5",
Expand All @@ -167,6 +169,7 @@
"react-native": "^0.74.6",
"react-native-builder-bob": "^0.32.0",
"react-test-renderer": "18.2.0",
"semantic-release": "^24.2.0",
"tsx": "^4.19.2",
"typescript": "^5.3.3"
},
Expand Down
Loading

0 comments on commit 069b6c5

Please sign in to comment.