-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #428 from anstadnik/fix_secrets
fix secrets
- Loading branch information
Showing
4 changed files
with
117 additions
and
89 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
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,47 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
release: | ||
required: true | ||
type: boolean | ||
upload-artifact: | ||
required: true | ||
type: boolean | ||
|
||
secrets: | ||
SHEET_ID: | ||
required: true | ||
|
||
jobs: | ||
build_and_test_bot: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Download the table | ||
if: inputs.release | ||
run: curl -L "docs.google.com/spreadsheets/d/${{ secrets.SHEET_ID }}/gviz/tq?tqx=out:csv&sheet=Ukrainian" -o table.csv | ||
|
||
- name: Test and build release | ||
if: inputs.release | ||
env: | ||
SHEET_ID: ${{ env.SHEET_ID }} | ||
run: cargo test --release && cargo build --release | ||
|
||
- name: Test and build debug | ||
if: ${{ !inputs.release }} | ||
env: | ||
SHEET_ID: ${{ env.SHEET_ID }} | ||
run: cargo test && cargo build | ||
|
||
- name: Move binary | ||
if: inputs.upload-artifact | ||
run: mv target/*/bot target | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: inputs.upload-artifact | ||
with: | ||
name: executable | ||
path: target/bot |
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,54 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
# release: | ||
# required: true | ||
# type: boolean | ||
upload-artifact: | ||
required: true | ||
type: boolean | ||
|
||
secrets: | ||
SHEET_ID: | ||
required: true | ||
|
||
jobs: | ||
build_flutter_apk: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: app | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: extractions/setup-just@v1 | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
cache: true | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "11" | ||
cache: "gradle" | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: aarch64-linux-android, armv7-linux-androideabi, x86_64-linux-android, i686-linux-android | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: baptiste0928/cargo-install@v2 | ||
with: | ||
crate: flutter_rust_bridge_codegen | ||
- uses: baptiste0928/cargo-install@v2 | ||
with: | ||
crate: cargo-ndk | ||
- uses: baptiste0928/cargo-install@v2 | ||
with: | ||
crate: cargo-expand | ||
- run: just && flutter build apk --release | ||
env: | ||
SHEET_ID: ${{ secrets.SHEET_ID }} | ||
- uses: actions/upload-artifact@v3 | ||
if: inputs.upload-artifact | ||
with: | ||
name: apk | ||
if-no-files-found: error | ||
path: app/build/app/outputs/flutter-apk/app-release.apk |