-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
111 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Nightly | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
env: | ||
SIGNING_KEYSTORE_FILE: ./signing_key.jks | ||
BUILD_APK_FILE: ./app/build/outputs/apk/release/app-release.apk | ||
OUTPUT_DIR: ./dist | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: npm | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: zulu | ||
java-version: 21 | ||
cache: gradle | ||
|
||
- name: 🚧 Do prerequisites | ||
run: npm ci | ||
|
||
- name: 🔢 Get version | ||
id: app_version | ||
run: echo "version=$(npm run --silent git:ref)" >> $GITHUB_OUTPUT | ||
|
||
- name: 🔎 Check for release | ||
run: npm run --silent git:tag-exists -- $TAG_NAME | ||
env: | ||
TAG_NAME: v${{ steps.app_version.outputs.version }} | ||
|
||
- name: 🔨 Generate certificate | ||
run: echo $SIGNING_KEYSTORE_FILE_CONTENT | base64 -di > $SIGNING_KEYSTORE_FILE | ||
env: | ||
SIGNING_KEYSTORE_FILE_CONTENT: ${{ secrets.SIGNING_KEYSTORE_FILE }} | ||
|
||
- name: 🔨 Build apk | ||
run: | | ||
npm run prebuild | ||
chmod +x ./gradlew | ||
./gradlew build | ||
env: | ||
SIGNING_KEYSTORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} | ||
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} | ||
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} | ||
|
||
- name: 📝 Rename apk | ||
run: mv $BUILD_APK_FILE $OUTPUT_DIR/symphony-nightly-v$APP_VERSION_NAME.apk | ||
env: | ||
APP_VERSION_NAME: ${{ steps.app_version.outputs.version }} | ||
|
||
- name: 🚀 Upload apk | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: v${{ steps.app_version.outputs.version }} | ||
artifacts: ${{ env.OUTPUT_DIR }}/* | ||
generateReleaseNotes: true | ||
draft: false | ||
prerelease: true | ||
artifactErrorsFailBuild: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ node_modules | |
*.g.json | ||
phrasey-dist | ||
app/src/main/assets/i18n | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { spawnSync } from "child_process"; | ||
|
||
const main = async () => { | ||
const proc = spawnSync("git", ["rev-parse", "--short", "HEAD"]); | ||
if (proc.status !== 0) throw new Error(`Unable to get ref`); | ||
console.log(proc.stdout.toString().trim()); | ||
}; | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { spawnSync } from "child_process"; | ||
|
||
const main = async () => { | ||
const [tag] = process.argv.slice(2); | ||
if (!tag) throw new Error("Missing argument: tag"); | ||
const proc = spawnSync("git", [ | ||
"ls-remote", | ||
"--exit-code", | ||
"--tags", | ||
"origin", | ||
tag, | ||
]); | ||
if (proc.status !== 0) throw new Error(`Tag ${tag} already exists`); | ||
console.log(`Tag ${tag} is available`); | ||
}; | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters