Skip to content

Commit

Permalink
Update ci.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
rizrmdhn authored Jun 13, 2024
1 parent 75ebd0b commit 1180fca
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
issues: write
deployments: write

steps:
- name: Checkout repository
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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 }}

0 comments on commit 1180fca

Please sign in to comment.