publish-apk #5
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: 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 }} | |
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" | |
- name: Run GH script | |
uses: actions/github-script@v7 | |
id: gh-script | |
env: | |
RELEASE_ID: ${{ github.event.client_payload.release_id }} | |
with: | |
github-token: ${{ secrets.SOURCE_GH_TOKEN }} | |
result-encoding: string | |
script: | | |
const { RELEASE_ID } = process.env | |
const result = await github.rest.repos.listReleaseAssets({ | |
owner: 'setlife-network', | |
repo: 'fedi', | |
release_id: RELEASE_ID | |
}) | |
console.log(`result: ${result}`) |