Skip to content

Commit

Permalink
chore: update CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
stnguyen90 committed May 20, 2024
1 parent 18c5342 commit 20a969c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Format and push

# Github action will require permission to write to repo
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
format:
runs-on: ubuntu-latest
container:
image: dart:stable

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: true
ref: ${{ github.event.pull_request.head.ref }}

- name: Format Dart code
run: dart format .

- name: git config
run: git config --global --add safe.directory /__w/sdk-for-dart/sdk-for-dart # required to fix dubious ownership

- name: Add & Commit
uses: EndBug/[email protected]
with:
add: lib

14 changes: 14 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Publish to pub.dev

on:
push:
tags:
- '[0-9]+\.[0-9]+\.[0-9]+.*'

jobs:
publish:
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
environment: pub.dev
3 changes: 1 addition & 2 deletions lib/src/enums/name.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ enum Name {
v1Certificates(value: 'v1-certificates'),
v1Builds(value: 'v1-builds'),
v1Messaging(value: 'v1-messaging'),
v1Migrations(value: 'v1-migrations'),
hamsterv1(value: 'hamsterv1');
v1Migrations(value: 'v1-migrations');

const Name({
required this.value
Expand Down

0 comments on commit 20a969c

Please sign in to comment.