Skip to content

[actions] upload pr artifacts to S3 #169

[actions] upload pr artifacts to S3

[actions] upload pr artifacts to S3 #169

Workflow file for this run

name: Release
on:
pull_request: { types: [opened, synchronize] }
jobs:
build:
name: Build
uses: ./.github/workflows/build-apk.yml
with:
version-name: ${{ github.sha }}
secrets:
google-services-json: ${{ secrets.GOOGLE_SERVICES_JSON }}
signing-key-store-base64: ${{ secrets.SIGNING_KEY_STORE_BASE64 }}
signing-key-alias: ${{ secrets.SIGNING_KEY_ALIAS }}
signing-key-password: ${{ secrets.SIGNING_KEY_PASSWORD }}
signing-store-password: ${{ secrets.SIGNING_STORE_PASSWORD }}
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: release-artifacts
- name: Upload to S3
uses: capcom6/upload-s3-action@d4d6efb2abf15cb029824e58ccd18d6b215fae11
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ secrets.AWS_BUCKET }}
endpoint: ${{ secrets.AWS_ENDPOINT }}
source_files: |
./apk/release/app-release.apk
./bundle/release/app-release.aab
destination_dir: apk/${{ github.event.pull_request.head.sha }}
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: Pull request artifacts
- name: Create comment
if: steps.fc.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
## 🤖 Pull request artifacts
| file | commit |
| ---- | ------ |
| [`app-release.apk`](https://s3.sms-gate.app/apk/${{ github.event.pull_request.head.sha }}/app-release.apk) | ${{ github.event.pull_request.head.sha }} |
| [`app-release.aab`](https://s3.sms-gate.app/apk/${{ github.event.pull_request.head.sha }}/app-release.aab) | ${{ github.event.pull_request.head.sha }} |
- name: Update comment
if: steps.fc.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
## 🤖 Pull request artifacts
| file | commit |
| ---- | ------ |
| [`app-release.apk`](https://s3.sms-gate.app/apk/${{ github.event.pull_request.head.sha }}/app-release.apk) | ${{ github.event.pull_request.head.sha }} |
| [`app-release.aab`](https://s3.sms-gate.app/apk/${{ github.event.pull_request.head.sha }}/app-release.aab) | ${{ github.event.pull_request.head.sha }} |