Skip to content

Commit 9a91dd0

Browse files
committed
[actions] upload pr artifacts to S3
1 parent 3efeff6 commit 9a91dd0

File tree

2 files changed

+44
-21
lines changed

2 files changed

+44
-21
lines changed

Diff for: .github/workflows/pr-build.yml

+38-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Release
22

33
on:
4-
pull_request: { types: [ opened, synchronize ] }
4+
pull_request: { types: [opened, synchronize] }
55

66
jobs:
77
build:
@@ -19,17 +19,44 @@ jobs:
1919
runs-on: ubuntu-latest
2020
needs: build
2121
steps:
22-
- uses: actions/download-artifact@v4
22+
- name: Download artifacts
23+
uses: actions/download-artifact@v4
2324
with:
2425
name: release-artifacts
25-
- name: Pull request artifacts
26-
uses: gavv/pull-request-artifacts@v2
26+
27+
- name: Upload to S3
28+
uses: capcom6/upload-s3-action@d4d6efb2abf15cb029824e58ccd18d6b215fae11
29+
env:
30+
AWS_REGION: ${{ secrets.AWS_REGION }}
2731
with:
28-
# Commit hash that triggered PR
29-
commit: ${{ github.event.pull_request.head.sha }}
30-
# Token for current repo (used to post PR comment)
31-
repo-token: ${{ secrets.GITHUB_TOKEN }}
32-
artifacts-branch: artifacts
33-
artifacts: |
32+
aws_key_id: ${{ secrets.AWS_KEY_ID }}
33+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
34+
aws_bucket: ${{ secrets.AWS_BUCKET }}
35+
endpoint: ${{ secrets.AWS_ENDPOINT }}
36+
source_files: |
3437
./apk/release/app-release.apk
35-
./bundle/release/app-release.aab
38+
./bundle/release/app-release.aab
39+
destination_dir: apk/${{ github.event.pull_request.head.sha }}
40+
41+
- name: Find Comment
42+
uses: peter-evans/find-comment@v3
43+
id: fc
44+
with:
45+
issue-number: ${{ github.event.pull_request.number }}
46+
comment-author: "github-actions[bot]"
47+
body-includes: Pull request artifacts
48+
49+
- name: Create or update comment
50+
uses: peter-evans/create-or-update-comment@v4
51+
with:
52+
comment-id: ${{ steps.fc.outputs.comment-id }}
53+
issue-number: ${{ github.event.pull_request.number }}
54+
body: |
55+
## 🤖 Pull request artifacts
56+
57+
| file | commit |
58+
| ---- | ------ |
59+
| [`app-release.apk`](https://s3.sms-gate.app/apk/${{ github.event.pull_request.head.sha }}/app-release.apk) | ${{ github.event.pull_request.head.sha }} |
60+
| [`app-release.aab`](https://s3.sms-gate.app/apk/${{ github.event.pull_request.head.sha }}/app-release.aab) | ${{ github.event.pull_request.head.sha }} |
61+
62+
edit-mode: replace

Diff for: .gitignore

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
2-
3-
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,android,androidstudio,intellij,linux,windows
4-
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos,android,androidstudio,intellij,linux,windows
2+
# Created by https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,macos,linux,intellij,androidstudio,android,dotenv
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,visualstudiocode,macos,linux,intellij,androidstudio,android,dotenv
54

65
### Android ###
76
# Gradle files
@@ -44,6 +43,9 @@ gen-external-apklibs
4443
# Replacement of .externalNativeBuild directories introduced
4544
# with Android Studio 3.5.
4645

46+
### dotenv ###
47+
.env
48+
4749
### Intellij ###
4850
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
4951
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
@@ -224,12 +226,6 @@ Temporary Items
224226
.history
225227
.ionide
226228

227-
# Support for Project snippet scope
228-
.vscode/*.code-snippets
229-
230-
# Ignore code-workspaces
231-
*.code-workspace
232-
233229
### Windows ###
234230
# Windows thumbnail cache files
235231
Thumbs.db
@@ -369,7 +365,7 @@ hs_err_pid*
369365

370366
!/gradle/wrapper/gradle-wrapper.jar
371367

372-
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,android,androidstudio,intellij,linux,windows
368+
# End of https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,macos,linux,intellij,androidstudio,android,dotenv
373369

374370
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
375371

0 commit comments

Comments
 (0)