Skip to content

Refactor publish workflow and remove dry-run script #50

Refactor publish workflow and remove dry-run script

Refactor publish workflow and remove dry-run script #50

Workflow file for this run

name: Publish workspace crates

Check failure on line 1 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish.yml

Invalid workflow file

(Line: 34, Col: 1): 'on' is already defined, (Line: 41, Col: 1): 'name' is already defined, (Line: 43, Col: 1): 'jobs' is already defined
on:
push:
branches:
- '**'
tags:
- '*'
pull_request:
branches:
- '**'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use latest stable Rust (dtolnay/rust-toolchain)
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Dry run workspace publish
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: cargo publish --workspace --dry-run --no-verify
- name: Publish workspace
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --workspace
on:
workflow_dispatch: {}
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Publish
jobs:
publish:
name: Publish
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: |
cargo publish ${ARGS} --package sqlx-rt-oldapi
cargo publish ${ARGS} --package sqlx-core-oldapi
cargo publish ${ARGS} --package sqlx-macros-oldapi
cargo publish ${ARGS} --package sqlx-oldapi
env:
ARGS:
--token ${{ secrets.CRATES_TOKEN }}
--no-default-features
--features runtime-actix-rustls