Skip to content

Commit 26d1652

Browse files
committed
ci: add secrets support
1 parent 848b76f commit 26d1652

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

.github/workflows/snap.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ jobs:
2020
with:
2121
channel: "stable"
2222
flutter-version: ${{env.FLUTTER_VERSION}}
23+
- run: echo ${{ secrets.API_KEY }} > secrets.txt
2324
- run: sudo apt update
2425
- run: sudo apt install -y clang cmake curl libgtk-3-dev ninja-build pkg-config unzip libunwind-dev libsecret-1-dev
2526
- run: flutter pub get
2627
- uses: snapcore/action-build@v1
27-
env:
28-
API_KEY: ${{ secrets.API_KEY }}
2928
id: build
3029
- uses: snapcore/action-publish@v1
3130
if: steps.build.outcome == 'success'
@@ -45,13 +44,12 @@ jobs:
4544
with:
4645
channel: "main"
4746
flutter-version: ${{env.FLUTTER_VERSION}}
47+
- run: echo ${{ secrets.API_KEY }} > secrets.txt
4848
- run: sudo apt update
4949
- run: sudo apt install -y clang cmake curl libgtk-3-dev ninja-build pkg-config unzip libunwind-dev libsecret-1-dev
5050
- run: flutter pub get
5151
- uses: snapcore/action-build@v1
5252
id: build
53-
env:
54-
API_KEY: ${{ secrets.API_KEY }}
5553
- uses: snapcore/action-publish@v1
5654
if: steps.build.outcome == 'success'
5755
env:

snap/snapcraft.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ parts:
4545
plugin: nil
4646
source: .
4747
after: [flutter-git]
48-
4948
override-build: |
5049
set -eu
5150
flutter doctor
5251
flutter pub get
53-
flutter build linux --release -v
52+
flutter build linux --release -v --dart-define=API_KEY="$(cat secrets.txt)"
5453
mkdir -p $CRAFT_PART_INSTALL/bin/
5554
cp -r build/linux/*/release/bundle/* $CRAFT_PART_INSTALL/bin/
5655

0 commit comments

Comments
 (0)