Skip to content

Commit

Permalink
Experiment with auto publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Oct 19, 2023
1 parent 682e054 commit 2dcc70f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI

on: [push, pull_request]
on:
push:
branches:
- '**' # we just don't want this to run redundantly on tags
pull_request:

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

on:
workflow_dispatch: # for testing purposes
push:
tags:
- 'sqlparser-[0-9]+.[0-9]+.[0-9]+*'

jobs:
setup:
uses: ./.github/workflows/setup.yml

# Published versions of sqlparser are tagged with `sqlparser-<version>`
publish_sqlparser:
# if: "${{ startsWith(github.ref_name, 'sqlparser-') }}"
needs: [setup]
runs-on: ubuntu-latest
environment: pub.dev
permissions:
id-token: write # used for getting a JWT
defaults:
run:
working-directory: sqlparser
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
with:
dart_version: ${{ needs.setup.outputs.dart_version }}
- run: dart pub get
- run: dart pub lish --dry-run

1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: drift_workspace
publish_to: none

environment:
sdk: ^2.19.0
Expand Down

0 comments on commit 2dcc70f

Please sign in to comment.