From c01b7d43eaf0bd6bed8e1dc64043aa76cbd8026a Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Fri, 25 Jul 2025 14:28:37 -0700 Subject: [PATCH] ci: remove old release workflows (#2015) --- .../workflows/calculate-alpha-release.bash | 52 ----------------- .github/workflows/release-alpha.yml | 57 ------------------- .github/workflows/release-stable.yml | 55 ------------------ 3 files changed, 164 deletions(-) delete mode 100755 .github/workflows/calculate-alpha-release.bash delete mode 100644 .github/workflows/release-alpha.yml delete mode 100644 .github/workflows/release-stable.yml diff --git a/.github/workflows/calculate-alpha-release.bash b/.github/workflows/calculate-alpha-release.bash deleted file mode 100755 index 5a761053..00000000 --- a/.github/workflows/calculate-alpha-release.bash +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -# Exit on error. Append "|| true" if you expect an error. -set -o errexit -# Exit on error inside any functions or subshells. -set -o errtrace -# Do not allow use of undefined vars. Use ${VAR:-} to use an undefined VAR -set -o nounset -# Catch the error in case mysqldump fails (but gzip succeeds) in `mysqldump |gzip` -set -o pipefail -# Turn on traces, useful while debugging but commented out by default -# set -o xtrace - -last_release="$(git tag --sort=committerdate | grep -P "v0+\.\d+\.\d+$" | tail -1)" -echo "🐭 Last release: ${last_release}" - -# detect breaking changes -if [ -n "$(git log --oneline ${last_release}..HEAD | grep '!:')" ]; then - echo "🐭 Breaking changes detected since ${last_release}" - git log --oneline ${last_release}..HEAD | grep '!:' - # increment the minor version - minor="${last_release##v0.}" - minor="${minor%.*}" - next_minor="$((minor + 1))" - next_release="v0.${next_minor}.0" -else - # increment the patch version - patch="${last_release##*.}" - next_patch="$((patch + 1))" - next_release="${last_release/%${patch}/${next_patch}}" -fi -echo "🐭 Next release: ${next_release}" - -suffix="alpha" -last_tag="$(git tag --sort=committerdate | tail -1)" -if [[ "${last_tag}" = "${next_release}-${suffix}"* ]]; then - echo "🐭 Last alpha release: ${last_tag}" - # increment the alpha version - # e.g. v0.22.1-alpha.12 -> v0.22.1-alpha.13 - alpha="${last_tag##*-${suffix}.}" - next_alpha="$((alpha + 1))" - next_tag="${last_tag/%${alpha}/${next_alpha}}" -else - # increment the patch and start the alpha version from 0 - # e.g. v0.22.0 -> v0.22.1-alpha.0 - next_tag="${next_release}-${suffix}.0" -fi -# update the crate version -msg="# crate version" -sed -E -i "s/^version = .* ${msg}$/version = \"${next_tag#v}\" ${msg}/" Cargo.toml -echo "NEXT_TAG=${next_tag}" >> $GITHUB_ENV -echo "🐭 Next alpha release: ${next_tag}" diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml deleted file mode 100644 index 5fb6f319..00000000 --- a/.github/workflows/release-alpha.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Release alpha version - -# Set the permissions of the github token to the minimum and only enable what is needed -# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions -permissions: {} - -on: - workflow_dispatch: - schedule: - # At 00:00 on Saturday - # https://crontab.guru/#0_0_*_*_6 - - cron: "0 0 * * 6" - -defaults: - run: - shell: bash - -jobs: - publish-alpha: - name: Create an alpha release - runs-on: ubuntu-latest - if: github.repository == 'ratatui/ratatui' - permissions: - contents: write - steps: - - name: Checkout the repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - with: - fetch-depth: 0 - # probably needs to be set to true for git-cliff to work - check build - persist-credentials: false - - - name: Calculate the next release - run: .github/workflows/calculate-alpha-release.bash - - - name: Install Rust stable - uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master - with: - toolchain: stable - - - name: Publish - run: cargo publish --allow-dirty --token ${{ secrets.CARGO_TOKEN }} - - - name: Generate a changelog - uses: orhun/git-cliff-action@4a4a951bc43fafe41cd2348d181853f52356bee7 # v4 - with: - config: cliff.toml - args: --unreleased --tag ${{ env.NEXT_TAG }} --strip header - env: - OUTPUT: BODY.md - - - name: Publish on GitHub - uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1 - with: - tag: ${{ env.NEXT_TAG }} - prerelease: true - bodyFile: BODY.md diff --git a/.github/workflows/release-stable.yml b/.github/workflows/release-stable.yml deleted file mode 100644 index 8bd00291..00000000 --- a/.github/workflows/release-stable.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release stable version - -# Set the permissions of the github token to the minimum and only enable what is needed -# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions -permissions: {} - -on: - push: - tags: - - "v*.*.*" - -jobs: - publish-stable: - name: Create an stable release - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout the repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - with: - fetch-depth: 0 - # this possibly needs to be set to true for git-cliff to work - check build results - persist-credentials: false - - - name: Generate a changelog - uses: orhun/git-cliff-action@4a4a951bc43fafe41cd2348d181853f52356bee7 # v4 - with: - config: cliff.toml - args: --latest --strip header - env: - OUTPUT: BODY.md - - - name: Publish on GitHub - uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1 - with: - prerelease: false - bodyFile: BODY.md - - publish-crate: - name: Publish crate - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - with: - persist-credentials: false - - - name: Install Rust stable - uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master - with: - toolchain: stable - - - name: Publish - run: cargo publish --token ${{ secrets.CARGO_TOKEN }}