Skip to content

Commit

Permalink
wip: test github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
otech47 committed Dec 6, 2023
1 parent 3f7e631 commit 621c8b1
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/public-release-with-apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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 }}
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 "RELEASE_ID=$RELEASE_ID" >> $GITHUB_OUTPUT
- name: Run GH script
uses: actions/github-script@v7
id: gh-script
env:
RELEASE_ID: ${{ steps.setup.RELEASE_ID }}
with:
github-token: ${{ secrets.SOURCE_GH_TOKEN }}
result-encoding: string
script: |
const { RELEASE_ID } = process.env
const result = github.rest.repos.listReleaseAssets({
owner: setlife-network,
repo: fedi,
release_id: RELEASE_ID
})
console.log(`result: ${result}`)

0 comments on commit 621c8b1

Please sign in to comment.