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 06470b7
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/public-release-with-apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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}`)

0 comments on commit 06470b7

Please sign in to comment.