38 lines
1.4 KiB
YAML
38 lines
1.4 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*/v*.*.*"
|
|
|
|
jobs:
|
|
Release:
|
|
runs-on: cimaster-latest
|
|
steps:
|
|
- name: 📦 Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- 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<<END_OF_FILE'
|
|
git show -s --format=%N "${{ github.ref_name }}" | tail -n +4 | awk 'BEGIN{RS="-----BEGIN PGP SIGNATURE-----"} NR==1{printf $0}'
|
|
echo END_OF_FILE
|
|
} >> "$GITHUB_ENV"
|
|
|
|
- name: 📤 Publish crate on code.thetadev.de
|
|
run: |
|
|
mkdir -p ~/.cargo
|
|
printf '[registries.thetadev]\nindex = "https://code.thetadev.de/ThetaDev/_cargo-index.git"\ntoken = "Bearer ${{ secrets.TOKEN_GITEA }}"\n' >> ~/.cargo/config.toml
|
|
sed -i "s/^rustypipe.*=\s*{/\0 registry = \"thetadev\",/g" Cargo.toml
|
|
cargo publish --registry thetadev --allow-dirty --package "${{ env.CRATE }}"
|
|
git restore Cargo.toml
|
|
|
|
- name: 🎉 Publish release
|
|
uses: https://gitea.com/actions/release-action@main
|
|
with:
|
|
title: "${{ env.CRATE }} ${{ env.CRATE_VERSION }}"
|
|
body: "${{ env.CHANGELOG }}"
|