-
Notifications
You must be signed in to change notification settings - Fork 2
Automate release process #14
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 all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -1,154 +1,33 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| lint: | ||
| lint-and-build: | ||
| name: Lint, Type Check & Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Lint files | ||
| run: yarn lint | ||
|
|
||
| - name: Typecheck files | ||
| run: yarn typecheck | ||
|
|
||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Run unit tests | ||
| run: yarn test --maxWorkers=2 --coverage | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd | ||
|
|
||
| build-library: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Build package | ||
| run: yarn prepare | ||
|
|
||
| build-android: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| TURBO_CACHE_DIR: .turbo/android | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Cache turborepo for Android | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: ${{ env.TURBO_CACHE_DIR }} | ||
| key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-turborepo-android- | ||
|
|
||
| - name: Check turborepo cache for Android | ||
| run: | | ||
| TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status") | ||
|
|
||
| if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then | ||
| echo "turbo_cache_hit=1" >> $GITHUB_ENV | ||
| fi | ||
|
|
||
| - name: Install JDK | ||
| if: env.turbo_cache_hit != 1 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| distribution: 'zulu' | ||
| java-version: '17' | ||
|
|
||
| - name: Finalize Android SDK | ||
| if: env.turbo_cache_hit != 1 | ||
| run: | | ||
| /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" | ||
|
|
||
| - name: Cache Gradle | ||
| if: env.turbo_cache_hit != 1 | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| ~/.gradle/wrapper | ||
| ~/.gradle/caches | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle- | ||
|
|
||
| - name: Build example for Android | ||
| env: | ||
| JAVA_OPTS: "-XX:MaxHeapSize=6g" | ||
| run: | | ||
| yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" | ||
|
|
||
| build-ios: | ||
| runs-on: macos-14 | ||
| env: | ||
| TURBO_CACHE_DIR: .turbo/ios | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Cache turborepo for iOS | ||
| uses: actions/cache@v3 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | ||
| with: | ||
| path: ${{ env.TURBO_CACHE_DIR }} | ||
| key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-turborepo-ios- | ||
| node-version-file: '.nvmrc' | ||
|
|
||
| - name: Check turborepo cache for iOS | ||
| run: | | ||
| TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status") | ||
| - name: Enable corepack | ||
| run: corepack enable | ||
|
|
||
| if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then | ||
| echo "turbo_cache_hit=1" >> $GITHUB_ENV | ||
| fi | ||
| - name: Install dependencies | ||
| run: yarn install --immutable | ||
|
|
||
| - name: Cache cocoapods | ||
| if: env.turbo_cache_hit != 1 | ||
| id: cocoapods-cache | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| **/ios/Pods | ||
| key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-cocoapods- | ||
| - name: Type check | ||
| run: yarn typecheck | ||
|
|
||
| - name: Install cocoapods | ||
| if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true' | ||
| run: | | ||
| cd example/ios | ||
| pod install | ||
| env: | ||
| NO_FLIPPER: 1 | ||
| - name: Lint check | ||
| run: yarn lint | ||
|
|
||
| - name: Build example for iOS | ||
| run: | | ||
| yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" | ||
| - name: Build | ||
| run: yarn prepare |
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,75 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Version bump type" | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - patch | ||
| - minor | ||
| - major | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
|
|
||
| - name: Enable corepack | ||
| run: corepack enable | ||
|
|
||
| - name: Bump version and update CHANGELOG | ||
| id: bump | ||
| run: | | ||
| NEW_VERSION=$(npm version ${{ github.event.inputs.version }} --no-git-tag-version) | ||
| echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT | ||
| sed -i "s/## \[Unreleased\]/## [Unreleased]\n\n## [$NEW_VERSION] - $(date +%Y-%m-%d)/" CHANGELOG.md | ||
|
|
||
| - name: Extract release notes | ||
| id: changelog | ||
| run: | | ||
| NOTES=$(awk '/## \[Unreleased\]/ {flag=1; next} /^## \[/ {flag=0} flag {print}' CHANGELOG.md) | ||
| echo "notes<<EOF" >> $GITHUB_OUTPUT | ||
| echo "$NOTES" >> $GITHUB_OUTPUT | ||
| echo "EOF" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Build and pack | ||
| id: pack | ||
| run: | | ||
| yarn install | ||
| yarn prepare | ||
| yarn pack --filename mendix-native-${{ steps.bump.outputs.version }}.tgz | ||
| echo "tgz=mendix-native-${{ steps.bump.outputs.version }}.tgz" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b | ||
| with: | ||
| tag_name: ${{ steps.bump.outputs.version }} | ||
| name: ${{ steps.bump.outputs.version }} | ||
| body: ${{ steps.changelog.outputs.notes }} | ||
| files: ${{ steps.pack.outputs.tgz }} | ||
|
|
||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 | ||
| with: | ||
| commit-message: "chore: release ${{ steps.bump.outputs.version }}" | ||
| branch: release/${{ steps.bump.outputs.version }} | ||
| title: "Release ${{ steps.bump.outputs.version }}" | ||
| body: "This PR updates CHANGELOG.md and package.json for release ${{ steps.bump.outputs.version }}." | ||
| base: main | ||
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ node_modules/ | |
| npm-debug.log | ||
| yarn-debug.log | ||
| yarn-error.log | ||
| *.tgz | ||
|
|
||
| # BUCK | ||
| buck-out/ | ||
|
|
||
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| v18 | ||
| 24 |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.