ci: add release workflow

This commit is contained in:
ThetaDev 2024-03-22 14:49:12 +01:00
parent c9f86c31f9
commit 9b7bd4c40c
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
4 changed files with 36 additions and 3 deletions

View file

@ -0,0 +1,29 @@
name: Release
on:
push:
tags:
- "*/v*.*.*"
jobs:
Release:
runs-on: cimaster-latest
steps:
- name: 📦 Checkout repository
uses: actions/checkout@v3
- name: Get variables
run: |
echo "CRATE=$(echo '${{ github.ref_name }}' | awk 'BEGIN{RS="/"} NR==1{print}')" >> $GITHUB_ENV
echo "CRATE_VERSION=$(echo '${{ github.ref_name }}' | awk 'BEGIN{RS="/"} NR==2{print}')" >> $GITHUB_ENV
echo "CHANGELOG=$(git show -s --format=%N "${{ github.ref_name }}" | tail -n +4)" >> $GITHUB_ENV
- name: 📤 Publish crate
run: |
printf '[registries.thetadev]\nindex = "https://code.thetadev.de/ThetaDev/_cargo-index.git"\ntoken = "Bearer ${{ secrets.GITHUB_TOKEN }}"\n' >> ~/.cargo/config.toml
cargo publish --registry thetadev --package "${{ env.CRATE }}"
- name: 🎉 Publish release
uses: https://gitea.com/actions/release-action@main
with:
title: "${{ env.CRATE }} ${{ env.CRATE_VERSION }}"
body: "${{ env.CHANGELOG }}"

View file

@ -62,6 +62,10 @@ tokio-test = "0.4.2"
insta = { version = "1.17.1", features = ["ron", "redactions"] }
path_macro = "1.0.0"
# Included crates
rustypipe = { path = ".", default-features = false }
rustypipe-downloader = { path = "./downloader", default-features = false }
[features]
default = ["default-tls"]

View file

@ -39,8 +39,8 @@ rustls-tls-native-roots = [
]
[dependencies]
rustypipe = { path = "../", default-features = false }
rustypipe-downloader = { path = "../downloader", default-features = false }
rustypipe.workspace = true
rustypipe-downloader.workspace = true
reqwest.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
futures.workspace = true

View file

@ -29,7 +29,7 @@ rustls-tls-native-roots = [
]
[dependencies]
rustypipe = { path = "../", default-features = false }
rustypipe.workspace = true
once_cell.workspace = true
regex.workspace = true
thiserror.workspace = true