Skip to content

Merge pull request #68 from NihilityT/upstream #32

Merge pull request #68 from NihilityT/upstream

Merge pull request #68 from NihilityT/upstream #32

Workflow file for this run

name: Release CI
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Force fetch Tags
run: |
git fetch --tags --force
- name: Get Tag
id: var
run: |
echo ::set-output name=tag::${GITHUB_REF#refs/*/}
echo ::set-output name=version::${GITHUB_REF#refs/*/v}
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Write key
run: |
if [ ! -z "${{ secrets.SIGNING_KEY }}" ]; then
echo STORE_PASSWORD='${{ secrets.KEY_STORE_PASSWORD }}' >> local.properties
echo KEY_ALIAS='${{ secrets.ALIAS }}' >> local.properties
echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}' >> local.properties
echo STORE_FILE_PATH='../release.keystore' >> local.properties
echo ${{ secrets.SIGNING_KEY }} | base64 --decode > release.keystore
fi
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleRelease
- name: Collect artifcat name
run: |
echo "release_artifact=$(basename -s .apk app/build/outputs/apk/release/*.apk)" >> $GITHUB_ENV
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.release_artifact }}
path: app/build/outputs/apk/release/*.apk
- name: Upload Mapping
uses: actions/upload-artifact@v3
with:
name: mapping
path: app/build/outputs/mapping/release/mapping.txt
- uses: ericcornelissen/git-tag-annotation-action@v2
id: tag-data
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.var.outputs.tag }}
token: ${{ secrets.GH_TOKEN }}
body: ${{ steps.tag-data.outputs.git-tag-annotation }}
artifacts: "app/build/outputs/apk/release/*.apk,app/build/outputs/mapping/release/mapping.txt"
allowUpdates: true
removeArtifacts: true
- name: Draft Release to XPosed Repo
uses: ncipollo/release-action@v1
with:
name: ${{ steps.var.outputs.tag }}
tag: ${{ steps.var.outputs.version }}
commit: main
owner: Xposed-Modules-Repo
repo: one.yufz.hmspush
token: ${{ secrets.GH_TOKEN }}
body: ${{ steps.tag-data.outputs.git-tag-annotation }}
artifacts: "app/build/outputs/apk/release/*.apk"
draft: true
allowUpdates: true
removeArtifacts: true
- name: Release to XPosed Repo
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.var.outputs.version }}
allowUpdates: true
owner: Xposed-Modules-Repo
repo: one.yufz.hmspush
token: ${{ secrets.GH_TOKEN }}
omitNameDuringUpdate: true
omitBodyDuringUpdate: true