Generate all_lint_rules #879
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: Generate all_lint_rules | |
on: | |
schedule: | |
- cron: "0 12 * * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
generate_all_rules: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Dart SDK | |
uses: dart-lang/setup-dart@v1.2 | |
- name: Install dependencies | |
run: dart pub get | |
- name: Install dependencies | |
run: dart pub get | |
working-directory: extract_rules/ | |
- name: Extract rules | |
run: dart extract_rules/bin/extract_rules.dart . --no-dry-run | |
- name: Write last result to env | |
run: |- | |
set -ex | |
echo "did_write=$([[ -f ".did_write" ]] && echo "true" || echo "false")" >> $GITHUB_ENV | |
- uses: EndBug/add-and-commit@v7 | |
if: ${{ env.did_write == 'true' }} | |
with: | |
message: "[Scheduled] Generate all.yaml" | |
default_author: github_actions | |
push: true | |
- name: Setup Pub Credentials | |
if: ${{ env.did_write == 'true' }} | |
run: | | |
echo "${{ secrets.GOOGLE_SERVICE_ACCOUNT }}" | base64 --decode > /tmp/service-account.json | |
gcloud auth activate-service-account --key-file=/tmp/service-account.json | |
gcloud auth print-identity-token --audiences=https://pub.dev | dart pub token add https://pub.dev | |
- name: Publish package | |
if: ${{ env.did_write == 'true' }} | |
run: dart pub publish -f |