Tag Xposed-Modules-Repo/[email protected] #29721
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: Tag | |
on: | |
workflow_dispatch: | |
inputs: | |
repo: | |
description: 'repo name' | |
required: true | |
release: | |
description: 'release id' | |
required: true | |
apk: | |
description: 'apk url' | |
required: true | |
tag: | |
description: 'tag name' | |
required: true | |
run-name: Tag ${{ github.event.inputs.repo }}@${{ github.event.inputs.tag }} | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
update_tag: | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
wget -O release.apk '${{ github.event.inputs.apk }}' | |
AAPT=$(ls $ANDROID_SDK_ROOT/build-tools/**/aapt2 | tail -1) | |
VERCODE=$($AAPT dump badging release.apk | head -1 | sed -n "/^package:/ s/^.*versionCode='\([0-9]*\)'.*/\1/p") | |
VERNAME=$($AAPT dump badging release.apk | head -1 | sed -n "/^package:/ s/^.*versionName='\([^']*\)'.*/\1/p") | |
VERNAME="${VERNAME// /_}" | |
echo '${{ github.event.inputs.tag }}' "-> $VERCODE-$VERNAME" | |
if [[ '${{ github.event.inputs.tag }}' == "$VERCODE-$VERNAME" ]]; then | |
exit | |
fi | |
mkdir test | |
cd test | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git init . | |
git commit -m "$VERCODE-$VERNAME" --allow-empty | |
git tag "$VERCODE-$VERNAME" -m "$VERCODE-$VERNAME" -f | |
git remote add origin "https://${{ secrets.GRAPHQL_TOKEN }}@github.com/${{ github.event.inputs.repo }}.git" | |
git push origin "$VERCODE-$VERNAME" -f | |
curl -X PATCH -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${{ secrets.GRAPHQL_TOKEN }}" https://api.github.com/repos/${{ github.event.inputs.repo }}/releases/${{ github.event.inputs.release }} -d "{\"tag_name\":\"${VERCODE}-${VERNAME}\"}" | |
deploy: | |
concurrency: | |
group: ${{ github.sha }} | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
name: Build Website | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Build | |
uses: ./.github/actions/build | |
with: | |
token: ${{ secrets.GRAPHQL_TOKEN }} | |
repo: ${{ github.event.inputs.repo }} |