Skip to content

publish-apk

publish-apk #1

name: Create or Update Release
on:
workflow_dispatch:
repository_dispatch:
types: [publish-apk]
jobs:
create-or-update-release:
runs-on: ubuntu-latest
steps:
- name: Set up variables
id: setup
run: |
VERSION=${{ github.event.client_payload.version }}
SHORT_COMMIT_HASH=${{ github.event.client_payload.short_commit_hash }}
ORIGINAL_APK_FILE=${{ github.event.client_payload.original_apk_file }}
RELEASE_ID=${{ github.event.client_payload.release_id }}
SOURCE_GH_TOKEN=${{ github.event.client_payload.source_github_access_token }}
TAG_NAME="v$VERSION"
RELEASE_TITLE="Fedi Alpha v${VERSION%.*} - APK Download"
NEW_APK_FILE="app-production-release-${VERSION}-${SHORT_COMMIT_HASH}.apk"
echo "VERSION $VERSION"
echo "SHORT_COMMIT_HASH $SHORT_COMMIT_HASH"
echo "ORIGINAL_APK_FILE $ORIGINAL_APK_FILE"
echo "TAG_NAME $TAG_NAME"
echo "RELEASE_TITLE $RELEASE_TITLE"
echo "NEW_APK_FILE $NEW_APK_FILE"
echo "RELEASE_ID $RELEASE_ID"
echo "SOURCE_GH_TOKEN $SOURCE_GH_TOKEN"
echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_OUTPUT
echo "SOURCE_GH_TOKEN=$SOURCE_GH_TOKEN" >> $GITHUB_OUTPUT
- name: Run GH script
uses: actions/github-script@v7
id: gh-script
with:
github-token: ${{ steps.setup.SOURCE_GH_TOKEN }}
result-encoding: string
script: |
const result = github.rest.repos.listReleaseAssets({
owner: setlife-network,
repo: fedi,
release_id: ${{ steps.setup.RELEASE_ID }}
})
console.log(`result: ${result}`)