Skip to content

Commit

Permalink
ci: update ci to support retrofit publish
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwang committed Jul 6, 2023
1 parent a11998e commit c9a994e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
@@ -1,5 +1,5 @@
# .github/workflows/publish.yml
name: Publish to pub.dev
name: Publish retrofit_generator to pub.dev

on:
push:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/publish-retrofit.yml
@@ -0,0 +1,30 @@
# .github/workflows/publish.yml
name: Publish retrofit to pub.dev

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

# Publish using custom workflow
jobs:
publish:
permissions:
id-token: write # Required for authentication using OIDC
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- name: Install dependencies
run: cd retrofit && dart pub get
# Here you can insert custom steps you need
# - run: dart tool/generate-code.dart
- name: Config examples
run: cp -r example retrofit/example
- name: Release new version
run: |
cd retrofit
RELEASE=${GITHUB_REF##*/}
sed -i -e "s/version:.*/version: $RELEASE/g" pubspec.yaml
- name: Publish
run: cd retrofit && dart pub publish --force
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
sdk: [stable, 2.19.6]
sdk: [2.19.6, stable]
steps:
- uses: actions/checkout@v3.5.2
- uses: dart-lang/setup-dart@v1.5.0
Expand Down

0 comments on commit c9a994e

Please sign in to comment.