add more token options #54
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
name: Build and Release | |
on: | |
push: | |
branches: ["main"] | |
# Declare default permissions as read only. | |
permissions: | |
contents: write | |
jobs: | |
test_nix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- run: nix flake show | |
- run: nix build ".#packages.x86_64-linux.auth_proxy" | |
- run: nix build ".#packages.x86_64-linux.vault_plugin" | |
pre_job: | |
needs: test_nix | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
paths_result: ${{ steps.skip_check.outputs.paths_result }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
paths_filter: | | |
app: | |
paths: | |
- 'app/**' | |
build: | |
needs: [pre_job, test_nix] | |
name: Build and Release | |
environment: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: "11.x" | |
distribution: temurin | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "^1.18.0" | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "0" | |
- name: Bump version and push tag | |
uses: anothrNick/[email protected] | |
id: tagger | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DEFAULT_BUMP: patch | |
- run: echo $KEY_JKS | base64 --decode > ../keys/key.jks && flutter build apk && flutter build appbundle | |
working-directory: ./app | |
env: | |
KEY_JKS: ${{ secrets.KEY_JKS }} | |
KEY_PASSWORD: ${{ secrets.ALIAS_PASSWORD }} | |
ALIAS_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
VERSION: ${{ steps.tagger.outputs.new_tag }} | |
- run: fastlane android deploy | |
working-directory: ./app | |
if: needs.pre_job.outputs.should_skip == 'true' || fromJSON(needs.pre_job.outputs.paths_result).app.should_skip | |
env: | |
GOOGLE_JSON_KEY: ${{ secrets.GOOGLE_JSON_KEY }} | |
VERSION: ${{ steps.tagger.outputs.new_tag }} | |
- name: Install Auth Proxy dependencies | |
working-directory: ./auth_proxy | |
run: go get . | |
- name: Build Auth Proxy | |
run: go build -v | |
working-directory: ./auth_proxy | |
- name: Build Vault Plugin | |
run: make build | |
working-directory: ./vault_plugin | |
- name: Push Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
app/build/app/outputs/flutter-apk/app-release.apk | |
app/build/app/outputs/bundle/release/app-release.aab | |
auth_proxy/auth_proxy | |
vault_plugin/vault/plugins/vepiot_vault | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ steps.tagger.outputs.new_tag }} | |
fail_on_unmatched_files: true | |
generate_release_notes: true |