-
Notifications
You must be signed in to change notification settings - Fork 27
ci: Release process #288
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
ci: Release process #288
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5dd4d21
ci: Release process
jamesnrokt 401a878
Update CHANGELOG.md
jamesnrokt 587145f
Update release-draft.yml
jamesnrokt 4cc235e
Update which files are expected to change
jamesnrokt 91dbf8a
Remove thomaseizinger changelog step
jamesnrokt 523a970
Update changelog links
jamesnrokt 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 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,76 @@ | ||
| name: Release Draft | ||
|
|
||
| on: | ||
| workflow_dispatch: # checkov:skip=CKV_GHA_7 | ||
| inputs: | ||
| bump-type: | ||
| description: Version bump type | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - patch | ||
| - minor | ||
| - major | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| create-release-pr: | ||
| name: Create Release PR | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Read current version | ||
| id: current-version | ||
| run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Bump version | ||
| id: bump-version | ||
| uses: actions-ecosystem/action-bump-semver@34e334551143a5301f38c830e44a22273c6ff5c5 # v1.0.0 | ||
| with: | ||
| current_version: ${{ steps.current-version.outputs.version }} | ||
| level: ${{ github.event.inputs.bump-type || 'patch' }} | ||
|
|
||
| - name: Write new version to VERSION | ||
| run: echo "${{ steps.bump-version.outputs.new_version }}" > VERSION | ||
|
|
||
| - name: Update package.json version | ||
| run: npm version "${{ steps.bump-version.outputs.new_version }}" --no-git-tag-version | ||
|
|
||
| - name: Generate changelog from git history | ||
| id: changelog | ||
| uses: ROKT/rokt-workflows/actions/generate-changelog@main | ||
BrandonStalnaker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| version: ${{ steps.bump-version.outputs.new_version }} | ||
|
|
||
| - name: Generate GitHub App token | ||
| id: generate-token | ||
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | ||
| with: | ||
| app-id: ${{ secrets.SDK_RELEASE_GITHUB_APP_ID }} | ||
| private-key: ${{ secrets.SDK_RELEASE_GITHUB_APP_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
| repositories: | | ||
| react-native-mparticle | ||
|
|
||
| - name: Create release PR | ||
| uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 | ||
BrandonStalnaker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| token: ${{ steps.generate-token.outputs.token }} | ||
| branch: release/${{ steps.bump-version.outputs.new_version }} | ||
| title: 'chore: release ${{ steps.bump-version.outputs.new_version }}' | ||
| body: | | ||
| ## Release ${{ steps.bump-version.outputs.new_version }} | ||
jamesnrokt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| These files should have changed during the release, if they didn't then this is likely an issue and should be investigated: | ||
| - package.json | ||
| - CHANGELOG.md | ||
|
|
||
| ${{ steps.changelog.outputs.release-notes }} | ||
| commit-message: 'chore: bump version to ${{ steps.bump-version.outputs.new_version }}' | ||
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,89 @@ | ||
| name: Release Publish | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - VERSION | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write # Required for npm OIDC trusted publishing | ||
|
|
||
| jobs: | ||
| react-tests: | ||
| name: Run React Native Unit Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 24 | ||
| cache: yarn | ||
| cache-dependency-path: yarn.lock | ||
|
|
||
| - name: Install node modules | ||
| run: yarn install | ||
|
|
||
| - name: Run tests | ||
| run: yarn test | ||
|
|
||
| android-unit-tests: | ||
| name: Run Android Unit Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run Android Unit Tests | ||
| run: cd android && ./gradlew test | ||
|
|
||
| publish: | ||
| name: Publish to npm and Create GitHub Release | ||
| runs-on: ubuntu-latest | ||
| needs: [react-tests, android-unit-tests] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Read version from VERSION | ||
| id: version | ||
| run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT" | ||
|
|
||
jamesnrokt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 24 | ||
| registry-url: https://registry.npmjs.org | ||
| cache: yarn | ||
| cache-dependency-path: yarn.lock | ||
|
|
||
| - name: Install node modules | ||
| run: yarn install | ||
|
|
||
| - name: Build SDK | ||
| run: yarn build | ||
|
|
||
| - name: Ensure npm CLI supports OIDC | ||
| run: npm install -g npm@latest | ||
|
|
||
| - name: Extract release notes from CHANGELOG.md | ||
| id: release-notes | ||
| uses: ffurrer2/extract-release-notes@202313ec7461b6b9e401996714484690ab1ae105 | ||
| with: | ||
| release_notes_file: RELEASE_NOTES.md | ||
|
|
||
| - name: Publish to npm | ||
| run: npm publish --provenance | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b | ||
| with: | ||
| tag: ${{ steps.version.outputs.version }} | ||
| name: ${{ steps.version.outputs.version }} | ||
| bodyFile: RELEASE_NOTES.md | ||
| commit: ${{ github.sha }} | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.