Skip to content

Commit

Permalink
chore: release PR updates example app and releases example app (#252)
Browse files Browse the repository at this point in the history
* chore: release PR updates example app and releases example app
* docs: update release process
  • Loading branch information
smallTrogdor authored Dec 16, 2024
1 parent 7811314 commit c781fb9
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
name: android_release
on: workflow_dispatch
on:
pull_request_target:
types:
- closed
branches:
- main

jobs:
build-and-release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'autorelease')

steps:
- uses: actions/checkout@v4
- name: Generate Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.APPBAKERYGITHUBAPP_APPID }}
private-key: ${{ secrets.APPBAKERYGITHUBAPP_PRIVATEKEY }}

- name: Clone Repository
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false

- uses: actions/setup-java@v4
with:
Expand Down
29 changes: 19 additions & 10 deletions .github/workflows/make-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,22 @@ jobs:
keep-unreleased-section: true
tag-prefix: ""

- name: Update Pubspec version
uses: Dbono-dev/[email protected]
with:
changes: |
{
"version": "${{ steps.update-changelog.outputs.version }}"
}
commentOutDevDependencies: "false"
- name: Update root pubspec
run: |
sed -i "s/^version:.*/version: ${{ steps.update-changelog.outputs.version }} # automatically set by GH Action /" pubspec.yaml
- name: Read and bump build number of example app
id: read_build_number
run: |
version=$(grep '^version:' example/pubspec.yaml | awk '{print $2}')
echo "Example version found: $version"
IFS='+' read -r build_name build_number <<< "$version"
new_build_number=$((build_number + 1))
echo "pubspec_build_number=$new_build_number" >> $GITHUB_OUTPUT
- name: Update example app pubspec
run: |
sed -i "s/^version:.*/version: ${{ steps.update-changelog.outputs.version }}+${{ steps.read_build_number.outputs.pubspec_build_number }} # automatically set by GH Action /" example/pubspec.yaml
- name: Create Pull Request
uses: peter-evans/[email protected]
Expand All @@ -62,9 +70,10 @@ jobs:
title: ${{ format('Auto Release Pull Request {0}', steps.update-changelog.outputs.version) }}
body: |
Make changes for release.
- Update pubspec
- Update pubspec.yaml
- Update CHANGELOG.md
- Update example/pubspec.yaml
**Merging this PR will trigger a github release using the corresponding workflow.**
**Merging this PR will trigger a github, pub dev and example app release using the corresponding workflows.**
labels: |
autorelease
14 changes: 13 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ workflow with the _patch_, _minor_ or _major_ option. This does several things:
1. Update the `pubspec.yaml` to reflect the new version.
2. Update the `CHANGELOG.md` to reflect the new version.
3. Commit and tag these changes in a new commit by the `sbb-app-bakery[bot]`.
4. Create a pull request with these changes with the `autorelease` label.
4. Create a **pull request** with these changes with the `autorelease` label.

**This pull request is the base for all subsequent release processes.**

##### Github release

Expand All @@ -21,3 +23,13 @@ Merging a pull request with the `autorelease` label will trigger the `github-rel

The creation of a tag in the `github-release` workflow triggers the `pubdev-release` workflow that will complete
all necessary steps for publishing the package to pubdev.

##### Example App release

Merging a pull request with the `autorelease` label will trigger the `android-release` workflow that

1. Builds the app
2. Signs the app
3. Publishes the app to the enterprise app store in the `alpha` channel


0 comments on commit c781fb9

Please sign in to comment.