From 1180fca494af996ee902d129f2fa5162ffd3ed2c Mon Sep 17 00:00:00 2001 From: Noor Rizki Ramadhan <114452320+rizrmdhn@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:22:56 +0800 Subject: [PATCH] Update ci.yaml --- .github/workflows/ci.yaml | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 307b1a2..f0ac941 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,11 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: write + packages: write + issues: write + deployments: write steps: - name: Checkout repository @@ -64,6 +69,12 @@ jobs: release: needs: build runs-on: ubuntu-latest + permissions: + contents: write + packages: write + issues: write + deployments: write + steps: - name: Checkout repository uses: actions/checkout@v2 @@ -112,9 +123,11 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash - - name: Get commit message - id: get_commit_message - run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" >> $GITHUB_ENV + - name: Get commit title + id: get_commit_title + run: | + COMMIT_TITLE=$(git log -1 --pretty=%s) + echo "COMMIT_TITLE=$(echo $COMMIT_TITLE | tr -d '\n' | tr -d '\r')" >> $GITHUB_ENV shell: bash - name: Create GitHub Release @@ -125,7 +138,7 @@ jobs: with: tag_name: ${{ env.new_version }} release_name: Release ${{ env.new_version }} - body: ${{ env.COMMIT_MESSAGE }} + body: ${{ env.COMMIT_TITLE }} draft: false prerelease: false @@ -138,3 +151,16 @@ jobs: asset_content_type: application/vnd.android.package-archive env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Additional APKs to Release + run: | + for file in $(ls *.apk); do + echo "Uploading $file" + curl -X POST \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/vnd.android.package-archive" \ + --data-binary @$file \ + "${{ steps.create_release.outputs.upload_url }}?name=$(basename $file)" + done + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}