chore: vendor capcom6/android-sms-gateway upstream (Apache-2.0 baseline fork)
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
name: Build APK
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
version-name:
|
||||
required: true
|
||||
type: string
|
||||
build-type:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
google-services-json:
|
||||
required: true
|
||||
signing-key-store-base64:
|
||||
required: true
|
||||
signing-key-alias:
|
||||
required: true
|
||||
signing-key-password:
|
||||
required: true
|
||||
signing-store-password:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-apk:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup JAVA 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: 17
|
||||
|
||||
- name: Cache Gradle and wrapper
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
||||
|
||||
- name: Setup Google Services
|
||||
run: echo ${{ secrets.google-services-json }} | base64 --decode > ./app/google-services.json
|
||||
|
||||
- name: Set App Version
|
||||
run: |
|
||||
export VERSION_NAME='${{ inputs.version-name }}'
|
||||
sed -i "s/versionName.*/versionName \"${VERSION_NAME#v}\"/" app/build.gradle
|
||||
sed -i "s/versionCode.*/versionCode $(( ($(date +%s) - $(date -d "2022-06-15" +%s)) / 86400 ))/" app/build.gradle
|
||||
|
||||
- name: Test
|
||||
run: ./gradlew test
|
||||
|
||||
#1
|
||||
- name: Decode Keystore
|
||||
env:
|
||||
ENCODED_STRING: ${{ secrets.signing-key-store-base64 }}
|
||||
SIGNING_KEY_STORE_PATH: app/keystore.jks
|
||||
|
||||
run: |
|
||||
echo $ENCODED_STRING > keystore-b64.txt
|
||||
base64 -d keystore-b64.txt > $SIGNING_KEY_STORE_PATH
|
||||
|
||||
#2
|
||||
- name: Build ${{ inputs.build-type }} apk
|
||||
env:
|
||||
SIGNING_KEY_STORE_PATH: app/keystore.jks
|
||||
SIGNING_KEY_ALIAS: ${{ secrets.signing-key-alias }}
|
||||
SIGNING_KEY_PASSWORD: ${{ secrets.signing-key-password }}
|
||||
SIGNING_STORE_PASSWORD: ${{ secrets.signing-store-password }}
|
||||
TARGET: ${{ inputs.build-type }}
|
||||
run: ./gradlew assemble${TARGET^}
|
||||
|
||||
- name: Build ${{ inputs.build-type }} bundle
|
||||
env:
|
||||
SIGNING_KEY_STORE_PATH: app/keystore.jks
|
||||
SIGNING_KEY_ALIAS: ${{ secrets.signing-key-alias }}
|
||||
SIGNING_KEY_PASSWORD: ${{ secrets.signing-key-password }}
|
||||
SIGNING_STORE_PASSWORD: ${{ secrets.signing-store-password }}
|
||||
TARGET: ${{ inputs.build-type }}
|
||||
run: ./gradlew bundle${TARGET^}
|
||||
#3
|
||||
- name: Upload ${{ inputs.build-type }} Build to Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.build-type }}-artifacts
|
||||
path: |
|
||||
app/build/outputs/apk/${{ inputs.build-type }}/
|
||||
app/build/outputs/bundle/${{ inputs.build-type }}/
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Close inactive issues and PRs
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 1 * * *"
|
||||
|
||||
jobs:
|
||||
close-issues:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/stale@v10
|
||||
with:
|
||||
days-before-stale: 7
|
||||
days-before-close: 7
|
||||
exempt-all-assignees: true
|
||||
|
||||
stale-issue-message: "This issue is stale because it has been open for 7 days with no activity."
|
||||
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale."
|
||||
stale-issue-label: "stale"
|
||||
|
||||
stale-pr-message: "This PR is stale because it has been open for 7 days with no activity."
|
||||
close-pr-message: "This PR was closed because it has been inactive for 7 days since being marked as stale."
|
||||
stale-pr-label: "stale"
|
||||
@@ -0,0 +1,22 @@
|
||||
name: Discord Release Notification
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
jobs:
|
||||
notify-discord:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.release.prerelease == false
|
||||
steps:
|
||||
- name: Send Discord Notification
|
||||
uses: capcom6/discord-webhook@3a447f4ed76c79ed32fb073d705bda1cd45119e6
|
||||
with:
|
||||
webhook-url: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
content: |
|
||||
🎉 New Release of [${{ github.event.repository.name }}](${{ github.event.repository.html_url }}): **${{ github.event.release.name }}**
|
||||
|
||||
${{ github.event.release.body }}
|
||||
|
||||
📦 Download: ${{ github.event.release.html_url }}
|
||||
flags: 4 # 4 = SUPPRESS_EMBEDS
|
||||
@@ -0,0 +1,22 @@
|
||||
name: Publish Docs
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Set App Version
|
||||
run: |
|
||||
sed -i "s/{{VERSION}}/${GITHUB_REF_NAME#v}/" docs/api/swagger.json
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./docs/api
|
||||
@@ -0,0 +1,78 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
pull_request: { types: [opened, synchronize, ready_for_review] }
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
build-type: [release, insecure]
|
||||
name: Build ${{ matrix.build-type }}
|
||||
if: github.event.pull_request.draft == false
|
||||
uses: ./.github/workflows/build-apk.yml
|
||||
with:
|
||||
version-name: ${{ github.sha }}
|
||||
build-type: ${{ matrix.build-type }}
|
||||
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
|
||||
if: github.event.pull_request.draft == false
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Download release artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-artifacts
|
||||
|
||||
- name: Download insecure artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: insecure-artifacts
|
||||
|
||||
- name: Upload to S3
|
||||
uses: capcom6/upload-s3-action@master
|
||||
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
|
||||
./apk/insecure/app-insecure.apk
|
||||
./bundle/insecure/app-insecure.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 or update comment
|
||||
uses: peter-evans/create-or-update-comment@v4
|
||||
with:
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
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 }} |
|
||||
| [`app-insecure.apk`](https://s3.sms-gate.app/apk/${{ github.event.pull_request.head.sha }}/app-insecure.apk) | ${{ github.event.pull_request.head.sha }} |
|
||||
| [`app-insecure.aab`](https://s3.sms-gate.app/apk/${{ github.event.pull_request.head.sha }}/app-insecure.aab) | ${{ github.event.pull_request.head.sha }} |
|
||||
|
||||
edit-mode: replace
|
||||
@@ -0,0 +1,23 @@
|
||||
name: Remove Labels on New Push
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize] # Trigger on PR opened or new commits pushed
|
||||
|
||||
jobs:
|
||||
remove_labels:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write # Grant permission to modify labels
|
||||
steps:
|
||||
# step 1: checkout repository code
|
||||
- name: Checkout code into workspace directory
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# step 2: remove specific labels
|
||||
- name: Remove specific labels
|
||||
run: |
|
||||
gh pr edit ${{ github.event.pull_request.number }} --remove-label "ready" || true
|
||||
gh pr edit ${{ github.event.pull_request.number }} --remove-label "deployed" || true
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,43 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
build-type: [release, insecure]
|
||||
name: Build ${{ matrix.build-type }}
|
||||
uses: ./.github/workflows/build-apk.yml
|
||||
with:
|
||||
version-name: ${{ github.ref_name }}
|
||||
build-type: ${{ matrix.build-type }}
|
||||
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:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-artifacts
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: insecure-artifacts
|
||||
- name: Create Github Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
generate_release_notes: true
|
||||
prerelease: true
|
||||
files: |
|
||||
./apk/release/app-release.apk
|
||||
./bundle/release/app-release.aab
|
||||
./apk/insecure/app-insecure.apk
|
||||
./bundle/insecure/app-insecure.aab
|
||||
Reference in New Issue
Block a user