ci: add release workflow
This commit is contained in:
parent
c9f86c31f9
commit
9b7bd4c40c
4 changed files with 36 additions and 3 deletions
29
.gitea/workflows/release.yaml
Normal file
29
.gitea/workflows/release.yaml
Normal 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 }}"
|
||||
Reference in a new issue