Skip to content

Commit 9538b5d

Browse files
committed
chore: replace travis with GitHub actions
1 parent 9f62ab1 commit 9538b5d

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/format.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Format and push
2+
3+
# Github action will require permission to write to repo
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
format:
12+
runs-on: ubuntu-latest
13+
container:
14+
image: dart:stable
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
persist-credentials: true
21+
ref: ${{ github.event.pull_request.head.ref }}
22+
23+
- name: Format Dart code
24+
run: dart format .
25+
26+
- name: git config
27+
run: git config --global --add safe.directory /__w/sdk-for-flutter/sdk-for-flutter # required to fix dubious ownership
28+
29+
- name: Add & Commit
30+
uses: EndBug/[email protected]
31+
with:
32+
add: lib
33+

.github/workflows/publish.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Publish to pub.dev
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+\.[0-9]+\.[0-9]+.*'
7+
8+
jobs:
9+
publish:
10+
permissions:
11+
id-token: write
12+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
13+
with:
14+
environment: pub.dev

0 commit comments

Comments
 (0)