Skip to content

Commit

Permalink
chore(cd): setup gh workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanBorai committed Feb 13, 2024
1 parent d96db42 commit f59845f
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
68 changes: 68 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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
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
});
2 changes: 1 addition & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "couriers"
version = "0.1.0"
version = "0.0.0"
edition = "2021"
authors = ["Esteban Borai <estebanborai@gmail.com>"]
publish = false
Expand Down

0 comments on commit f59845f

Please sign in to comment.