Skip to content

3.4.0

3.4.0 #57

Workflow file for this run

name: Deploy release
on:
release:
types: [prereleased, released]
jobs:
deploy-apk:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build APK
run: bash ./gradlew assembleRelease --stacktrace
- name: Setup build tool version variable
shell: bash
run: |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
echo Last build tool version is: $BUILD_TOOL_VERSION
- uses: r0adkll/sign-android-release@v1
name: Sign app APK
id: sign_app_apk
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
- name: Upload APK Release Asset
id: upload-release-asset-apk
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{steps.sign_app_apk.outputs.signedReleaseFile}}
asset_name: app-release.apk
asset_content_type: application/zip
deploy-aar:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build AAR
run: bash ./gradlew :securesmsproxyapi:assembleRelease --stacktrace
- name: Upload AAR Release Asset
id: upload-release-asset-aar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: securesmsproxyapi/build/outputs/aar/securesmsproxyapi-release.aar
asset_name: securesmsproxyapi-release.aar
asset_content_type: application/zip
- name: Prepare Ringfile
if: steps.get_release.outputs.prerelease == 'false'
run: echo "${{ secrets.gpg_ringfile }}" | base64 --decode > ringfile
- name: Publish AAR
if: steps.get_release.outputs.prerelease == 'false'
run: bash ./gradlew :securesmsproxyapi:publish --stacktrace
env:
SIGNING_KEYID: ${{ secrets.gpg_key_id }}
SIGNING_PASSWORD: ${{ secrets.gpg_passphrase }}
SIGNING_RINGFILE: ../ringfile
OSS_USERNAME: ${{ secrets.nexus_username }}
OSS_PASSWORD: ${{ secrets.nexus_password }}
update-repo:
runs-on: ubuntu-22.04
needs: deploy-apk
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Checkout release/next branch
run: |
git checkout release/next
- name: Read version.properties
id: read_version_properties
run: |
while IFS='=' read -r key value; do
if [ "$key" ]; then
echo "$key=$value"
# Set as environment variable
echo "$key=$value" >> $GITHUB_OUTPUT
fi
done < app/version.properties
- name: Checkout master branch
run: |
git checkout master
- name: Update README.md
run: |
sed -i "s/'com.github.frimtec:secure-sms-proxy-api:.*'/'com.github.frimtec:secure-sms-proxy-api:${{ steps.read_version_properties.outputs.VERSION_NAME }}@aar'/g" README.md
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create fastlane changelog
run: |
mkdir -p fastlane/metadata/android/en-US/changelogs
echo "${{ steps.get_release.outputs.body }}" | sed '/^-/!d;s/- #[[:digit:]]\+ \(.*\) @\(.*\)/- \1/g' | head -n 10 >> fastlane/metadata/android/en-US/changelogs/${{ steps.read_version_properties.outputs.VERSION_CODE }}.txt
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add README.md
git add fastlane/metadata/android/en-US/changelogs/${{ steps.read_version_properties.outputs.VERSION_CODE }}.txt
git commit -m "Update release version/changelog for ${{ steps.read_version_properties.outputs.VERSION_NAME }}"
- name: Push changes
uses: ad-m/github-push-action@v0.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 'master'