Release Next Version #21
This file contains 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: Release Next Version | |
on: | |
workflow_dispatch: | |
inputs: | |
release_tag: | |
description: 'Release Version' | |
required: true | |
type: string | |
release_code: | |
description: 'Release Version Code' | |
required: true | |
type: string | |
env: | |
NEW_VERSION: ${{ github.event.inputs.release_tag }} | |
NEW_VERSION_CODE: ${{ github.event.inputs.release_code }} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
fetch-depth: 0 | |
token: ${{ secrets.PROJECT_TOKEN }} | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '17' | |
- name: Modify for next release | |
run: | | |
cd react-native | |
chmod +x release.sh | |
./release.sh ${{ env.NEW_VERSION }} ${{ env.NEW_VERSION_CODE }} | |
npm i | |
cd .. | |
git diff | |
git add . | |
git config user.name '${{ vars.USER_NAME }}' | |
git config user.email '${{ vars.USER_EMAIL }}' | |
git commit -m 'release: SwiftChat v${{ env.NEW_VERSION }}' | |
git push | |
git tag ${{ env.NEW_VERSION }} | |
git push origin ${{ env.NEW_VERSION }} | |
- name: Prepare release file | |
run: | | |
cd react-native/android | |
./gradlew assembleRelease | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: "SwiftChat v${{ env.NEW_VERSION }}" | |
files: | | |
react-native/android/app/build/outputs/apk/release/*.apk | |
tag_name: "${{ env.NEW_VERSION }}" | |
prerelease: true | |
generate_release_notes: true |