name: Release on: push: tags: - "*/v*.*.*" jobs: Release: runs-on: cimaster-latest steps: - name: 📦 Checkout repository uses: actions/checkout@v4 - name: Get variables run: | CRATE=$(echo '${{ github.ref_name }}' | awk 'BEGIN{RS="/"} NR==1{print}') echo "CRATE=$CRATE" >> "$GITHUB_ENV" echo "CRATE_VERSION=$(echo '${{ github.ref_name }}' | awk 'BEGIN{RS="/"} NR==2{print}')" >> "$GITHUB_ENV" CL_PATH="CHANGELOG.md" if [[ "$CRATE" != "rustypipe" ]]; then pfx="rustypipe-"; CL_PATH="${CRATE#"$pfx"}/$CL_PATH"; fi { echo 'CHANGELOG<> "$GITHUB_ENV" - name: 📤 Publish crate on code.thetadev.de run: | mkdir -p ~/.cargo printf '\n\n[registries.thetadev]\nindex = "https://code.thetadev.de/ThetaDev/_cargo-index.git"\ntoken = "Bearer ${{ secrets.FORGEJO_CI_TOKEN }}"\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 }}"