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<> "$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 }}"