Skip to content

Commit

Permalink
refactor: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebus-84 committed Nov 21, 2024
1 parent 1def8b0 commit 6860ca2
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 267 deletions.
107 changes: 17 additions & 90 deletions .github/workflows/alpha_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,98 +3,25 @@ name: '🧪 and 📢 and 📲'
on:
push:
branches: ['main']

jobs:
tests:
runs-on: ubuntu-latest
environment: test
steps:
- uses: actions/checkout@v4
- uses: dyne/pnpm@main
with:
node-version: '20.11.1'
submodules: true
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- uses: supplypike/setup-bin@v4
with:
uri: https://github.com/dyne/zenroom/releases/latest/download/zencode-exec
name: zencode-exec
version: latest
- run: |
git clone --recursive https://github.com/forkbombeu/signroom
cd signroom/admin
mkdir pb_data
cp ../../tests/fixtures/test.db pb_data/data.db
rm pb_migrations/1685000000_seed_features.js
go build
./pb migrate
./pb serve &
- run: npx playwright install --with-deps
- run: pnpm test:integration --workers 1
env:
PUBLIC_BACKEND_URL: http://localhost:8090
USER_EMAIL: ${{ vars.USER_EMAIL }}
USER_PASSWORD: ${{ vars.USER_PASSWORD }}
USER_SEED: ${{ vars.USER_SEED }}
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-results
path: test-results/
retention-days: 10
uses: ./.github/workflows/test.yml
with:
backend-url: http://localhost:8090
user-email: ${{ vars.USER_EMAIL }}
user-password: ${{ vars.USER_PASSWORD }}
user-seed: ${{ vars.USER_SEED }}

distribute:
runs-on: ubuntu-latest
environment: test
uses: ./.github/workflows/distribute.yml
needs: tests
steps:
- uses: dyne/pnpm@main
with:
submodules: true
node-version: '20.11.1'
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: playstore_keystore
with:
fileName: android_keystore.keystore
encodedString: ${{ secrets.BUNDLE_BETA_PLAYSTORE }}
- name: Decode Service Account File for Firebase
uses: timheuer/base64-to-file@v1
id: service_account
with:
fileName: play-store-credentials.json
encodedString: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
- name: Decode Service Account File for PlayStore
uses: timheuer/base64-to-file@v1
id: play_console_account
with:
fileName: play-store-credentials.json
encodedString: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- uses: maierj/[email protected]
env:
KEYSTORE_PATH: ${{ steps.playstore_keystore.outputs.filePath }}
SERVICE_ACCOUNT_PATH: ${{ steps.play_console_account.outputs.filePath }}
KEYSTORE_KEY_ALIAS: ${{ secrets.BUNDLE_BETA_PLAYSTORE_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.BUNDLE_BETA_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.BUNDLE_BETA_PASSWORD }}
PUBLIC_BACKEND_URL: ${{ vars.PUBLIC_BACKEND_URL }}
with:
lane: alpha
with:
backend-url: ${{ vars.PUBLIC_BACKEND_URL }}
lane: alpha
secrets:
keystore-file: ${{ secrets.BUNDLE_BETA_PLAYSTORE }}
firebase-service-account: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
playstore-service-account: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}
keystore-alias: ${{ secrets.BUNDLE_BETA_PLAYSTORE_ALIAS }}
keystore-password: ${{ secrets.BUNDLE_BETA_PASSWORD }}
107 changes: 18 additions & 89 deletions .github/workflows/beta_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,26 @@ name: 'publish beta'

on:
workflow_dispatch:

jobs:
tests:
runs-on: ubuntu-latest
environment: test
steps:
- uses: actions/checkout@v4
- uses: dyne/pnpm@main
with:
node-version: '20.11.1'
submodules: true
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- uses: supplypike/setup-bin@v4
with:
uri: https://github.com/dyne/zenroom/releases/latest/download/zencode-exec
name: zencode-exec
version: latest
- run: |
git clone --recursive https://github.com/forkbombeu/signroom
cd signroom/admin
mkdir pb_data
cp ../../tests/fixtures/test.db pb_data/data.db
rm pb_migrations/1685000000_seed_features.js
go build
./pb migrate
./pb serve &
- run: npx playwright install --with-deps
- run: pnpm test:integration --workers 1
env:
PUBLIC_BACKEND_URL: http://localhost:8090
USER_EMAIL: ${{ vars.USER_EMAIL }}
USER_PASSWORD: ${{ vars.USER_PASSWORD }}
USER_SEED: ${{ vars.USER_SEED }}
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-results
path: test-results/
retention-days: 10
uses: ./.github/workflows/test.yml
with:
backend-url: http://localhost:8090
user-email: ${{ vars.USER_EMAIL }}
user-password: ${{ vars.USER_PASSWORD }}
user-seed: ${{ vars.USER_SEED }}

distribute:
runs-on: ubuntu-latest
uses: ./.github/workflows/distribute.yml
needs: tests
steps:
- uses: dyne/pnpm@main
with:
submodules: true
node-version: '20.11.1'
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: playstore_keystore
with:
fileName: android_keystore.keystore
encodedString: ${{ secrets.BUNDLE_BETA_PLAYSTORE }}
- name: Decode Service Account File for Firebase
uses: timheuer/base64-to-file@v1
id: service_account
with:
fileName: play-store-credentials.json
encodedString: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
- name: Decode Service Account File for PlayStore
uses: timheuer/base64-to-file@v1
id: play_console_account
with:
fileName: play-store-credentials.json
encodedString: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- uses: maierj/[email protected]
env:
KEYSTORE_PATH: ${{ steps.playstore_keystore.outputs.filePath }}
SERVICE_ACCOUNT_PATH: ${{ steps.play_console_account.outputs.filePath }}
KEYSTORE_KEY_ALIAS: ${{ secrets.BUNDLE_BETA_PLAYSTORE_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.BUNDLE_BETA_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.BUNDLE_BETA_PASSWORD }}
PUBLIC_BACKEND_URL: ${{ vars.PUBLIC_BACKEND_URL }}
with:
lane: beta
with:
backend-url: ${{ vars.PUBLIC_BACKEND_URL }}
lane: beta
secrets:
keystore-file: ${{ secrets.BUNDLE_BETA_PLAYSTORE }}
firebase-service-account: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
playstore-service-account: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}
keystore-alias: ${{ secrets.BUNDLE_BETA_PLAYSTORE_ALIAS }}
keystore-password: ${{ secrets.BUNDLE_BETA_PASSWORD }}

77 changes: 77 additions & 0 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# .github/workflows/distribute.yml
name: Reusable Distribute Workflow

on:
workflow_call:
inputs:
backend-url:
required: true
type: string
lane:
required: true
type: string
secrets:
keystore-file:
required: true
firebase-service-account:
required: true
playstore-service-account:
required: true
keystore-alias:
required: true
keystore-password:
required: true

jobs:
distribute:
runs-on: ubuntu-latest
steps:
- uses: dyne/pnpm@main
with:
submodules: true
node-version: '20.11.1'
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: playstore_keystore
with:
fileName: android_keystore.keystore
encodedString: ${{ secrets.keystore-file }}
- name: Decode Service Account File for Firebase
uses: timheuer/base64-to-file@v1
id: service_account
with:
fileName: firebase-service-account.json
encodedString: ${{ secrets.firebase-service-account }}
- name: Decode Service Account File for PlayStore
uses: timheuer/base64-to-file@v1
id: play_console_account
with:
fileName: play-store-credentials.json
encodedString: ${{ secrets.playstore-service-account }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- uses: maierj/[email protected]
env:
KEYSTORE_PATH: ${{ steps.playstore_keystore.outputs.filePath }}
SERVICE_ACCOUNT_PATH: ${{ steps.play_console_account.outputs.filePath }}
KEYSTORE_KEY_ALIAS: ${{ secrets.keystore-alias }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.keystore-password }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.keystore-password }}
PUBLIC_BACKEND_URL: ${{ inputs.backend-url }}
with:
lane: ${{ inputs.lane }}
Loading

0 comments on commit 6860ca2

Please sign in to comment.