Fix version code #12
Workflow file for this run
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: Pixel Icon Provider push CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v2 | |
- name: Setup Android SDK | |
run: | | |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.3" | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- name: Set up gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- uses: gradle/actions/setup-gradle@v3 | |
with: | |
arguments: assembleRelease | |
- name: Save version tag in env | |
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'breezy-weather/pixel-icon-provider' | |
run: | | |
set -x | |
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
- name: Sign APK | |
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'breezy-weather/pixel-icon-provider' | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
- name: Prepare APKs with checksums | |
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'breezy-weather/pixel-icon-provider' | |
run: | | |
set -e | |
mv app/build/outputs/apk/release/app-release-unsigned-signed.apk pixel-icon-provider-${{ env.VERSION_TAG }}.apk | |
sha256=`sha256sum pixel-icon-provider-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` | |
echo "APK_SHA256=$sha256" >> $GITHUB_ENV | |
- name: Create release | |
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'breezy-weather/pixel-icon-provider' | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.VERSION_TAG }} | |
name: Pixel Icon Provider ${{ env.VERSION_TAG }} | |
body: | | |
--- | |
### Checksum | |
${{ env.APK_SHA256 }} | |
files: | | |
pixel-icon-provider-${{ env.VERSION_TAG }}.apk | |
draft: true | |
prerelease: false |