name: Release on: push: tags: - "*/v*.*.*" jobs: Release: runs-on: cimaster-latest steps: - name: 📦 Checkout repository uses: actions/checkout@v3 - name: Get variables run: | git fetch --tags --force #the checkout action does not load the tag message 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 crates.io run: cargo publish --token ${{ secrets.CARGO_TOKEN }} --package "${{ env.CRATE }}" - name: 🎉 Publish release uses: https://gitea.com/actions/release-action@main with: title: "${{ env.CRATE }} ${{ env.CRATE_VERSION }}" body: "${{ env.CHANGELOG }}"