Prepare new release #57
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
| name: Prepare new release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| semanticBump: | |
| description: "Bump semantic version" | |
| required: true | |
| default: "false" | |
| type: choice | |
| options: | |
| - "false" | |
| - minor | |
| - patch | |
| mobileBump: | |
| description: "Bump mobile build number" | |
| required: false | |
| type: boolean | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-root | |
| cancel-in-progress: true | |
| jobs: | |
| bump_version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| ref: ${{ steps.push-tag.outputs.commit_long_sha }} | |
| gira_version: ${{ env.GIRA_VERSION }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.ORG_RELEASE_TOKEN }} | |
| - name: Bump version | |
| run: misc/release/bump-version.sh -s "${{ inputs.semanticBump }}" -m "${{ inputs.mobileBump }}" | |
| - name: Get user details | |
| id: user-details | |
| run: | | |
| echo "name=$(gh api /users/${{ github.actor }} --jq '.name // .login')" >> $GITHUB_OUTPUT | |
| echo "email=$(gh api /users/${{ github.actor }} --jq '.email // "${github.actor}@users.noreply.github.com"')" >> $GITHUB_OUTPUT | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Commit and tag | |
| id: push-tag | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| author_name: ${{ steps.user-details.outputs.name }} | |
| author_email: ${{ steps.user-details.outputs.email }} | |
| message: ${{ inputs.semanticBump == 'false' && inputs.mobileBump == true && 'Bump mobile build number' || format('Bump version to {0}', env.GIRA_VERSION) }} | |
| tag: ${{ inputs.semanticBump != 'false' && env.GIRA_VERSION || '' }} | |
| push: true | |
| build_mobile: | |
| uses: ./.github/workflows/build-mobile.yml | |
| needs: bump_version | |
| secrets: inherit | |
| with: | |
| ref: ${{ needs.bump_version.outputs.ref }} | |
| prepare_release: | |
| runs-on: ubuntu-latest | |
| needs: build_mobile | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.ORG_RELEASE_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Download APK | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-apk-signed | |
| - name: Rename APK | |
| run: mv *.apk Gira+.apk | |
| - name: Get commit messages | |
| id: get_commits | |
| run: | | |
| PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^) | |
| git log ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s" > commit_messages.txt | |
| - name: Create draft release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| draft: true | |
| tag_name: ${{ needs.bump_version.outputs.gira_version }} | |
| files: | | |
| *.apk | |
| body_path: commit_messages.txt | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| upload_play_store: | |
| runs-on: ubuntu-latest | |
| needs: build_mobile | |
| steps: | |
| - name: Download aab | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-aab-signed | |
| - name: Upload .aab to Production Track | |
| id: upload_production | |
| uses: KevinRohn/github-action-upload-play-store@v1.0.0 | |
| with: | |
| service_account_json: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
| package_name: "dev.tteles.gira" | |
| aab_file_path: "./app-release.aab" | |
| track: "alpha" | |
| release_status: "draft" | |
| upload_app_store: | |
| runs-on: macos-latest | |
| needs: build_mobile | |
| steps: | |
| - name: Download ipa | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: app-ios | |
| - name: Publish the App on TestFlight | |
| env: | |
| APPLEID_USERNAME: ${{ secrets.APPLEID_USERNAME }} | |
| APPLEID_PASSWORD: ${{ secrets.APPLEID_PASSWORD }} | |
| run: | | |
| xcrun altool \ | |
| --upload-app \ | |
| -t ios \ | |
| -f $PWD/*.ipa \ | |
| -u "${{ secrets.APPLEID_USERNAME }}" \ | |
| -p "${{ secrets.APPLEID_PASSWORD }}" |