Skip to content

chore(cd): publish depend on dry-run #3

chore(cd): publish depend on dry-run

chore(cd): publish depend on dry-run #3

Workflow file for this run

name: Release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
permissions:
contents: write
issues: write
pull-requests: write
jobs:
publish-dry-run:
name: Test Publish with Dry Run
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: publish crate
run: cargo publish -p couriers --dry-run
publish:
name: Publish Crate
runs-on: ubuntu-latest
needs: publish-dry-run
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Login to Crates.io
run: cargo login ${CRATES_IO_TOKEN}
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish crate
run: cargo publish -p couriers
release:
name: Create Release
needs: publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Create Release
id: create_release
uses: actions/github-script@v7
with:
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});