mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-14 00:47:14 +00:00
chore(ci): update release strategy (#1337)
closes #1232 Now we can trigger point releases by pushing a tag (follow the instructions in `RELEASE.md`). This will create a release with generated changelog. There is still a lack of automation (e.g. updating `CHANGELOG.md`), but this PR is a good start towards improving that.
This commit is contained in:
parent
9ed85fd1dd
commit
65da535745
3 changed files with 59 additions and 25 deletions
|
@ -1,4 +1,4 @@
|
||||||
name: Continuous Deployment
|
name: Release alpha version
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
@ -6,9 +6,6 @@ on:
|
||||||
# At 00:00 on Saturday
|
# At 00:00 on Saturday
|
||||||
# https://crontab.guru/#0_0_*_*_6
|
# https://crontab.guru/#0_0_*_*_6
|
||||||
- cron: "0 0 * * 6"
|
- cron: "0 0 * * 6"
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*.*.*"
|
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
@ -20,7 +17,6 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
if: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -30,11 +26,11 @@ jobs:
|
||||||
- name: Calculate the next release
|
- name: Calculate the next release
|
||||||
run: .github/workflows/calculate-alpha-release.bash
|
run: .github/workflows/calculate-alpha-release.bash
|
||||||
|
|
||||||
- name: Publish on crates.io
|
- name: Install Rust stable
|
||||||
uses: actions-rs/cargo@v1
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
command: publish
|
- name: Publish
|
||||||
args: --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
|
run: cargo publish --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
|
||||||
|
|
||||||
- name: Generate a changelog
|
- name: Generate a changelog
|
||||||
uses: orhun/git-cliff-action@v3
|
uses: orhun/git-cliff-action@v3
|
||||||
|
@ -50,17 +46,3 @@ jobs:
|
||||||
tag: ${{ env.NEXT_TAG }}
|
tag: ${{ env.NEXT_TAG }}
|
||||||
prerelease: true
|
prerelease: true
|
||||||
bodyFile: BODY.md
|
bodyFile: BODY.md
|
||||||
|
|
||||||
publish-stable:
|
|
||||||
name: Create a stable release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ startsWith(github.event.ref, 'refs/tags/v') }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout the repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Publish on crates.io
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: publish
|
|
||||||
args: --token ${{ secrets.CARGO_TOKEN }}
|
|
45
.github/workflows/release-stable.yml
vendored
Normal file
45
.github/workflows/release-stable.yml
vendored
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
name: Release stable version
|
||||||
|
|
||||||
|
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@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Generate a changelog
|
||||||
|
uses: orhun/git-cliff-action@v3
|
||||||
|
with:
|
||||||
|
config: cliff.toml
|
||||||
|
args: --latest --strip header
|
||||||
|
env:
|
||||||
|
OUTPUT: BODY.md
|
||||||
|
|
||||||
|
- name: Publish on GitHub
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
prerelease: false
|
||||||
|
bodyFile: BODY.md
|
||||||
|
|
||||||
|
publish-crate:
|
||||||
|
name: Publish crate
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Rust stable
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Publish
|
||||||
|
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}
|
|
@ -1,5 +1,12 @@
|
||||||
# Creating a Release
|
# Creating a Release
|
||||||
|
|
||||||
|
Our release strategy is:
|
||||||
|
|
||||||
|
> Release major versions with detailed summaries when necessary, while releasing minor versions
|
||||||
|
> weekly or as needed without extensive announcements.
|
||||||
|
>
|
||||||
|
> Versioning scheme being `0.x.y`, where `x` is the major version and `y` is the minor version.
|
||||||
|
|
||||||
[crates.io](https://crates.io/crates/ratatui) releases are automated via [GitHub
|
[crates.io](https://crates.io/crates/ratatui) releases are automated via [GitHub
|
||||||
actions](.github/workflows/cd.yml) and triggered by pushing a tag.
|
actions](.github/workflows/cd.yml) and triggered by pushing a tag.
|
||||||
|
|
||||||
|
@ -21,7 +28,7 @@ actions](.github/workflows/cd.yml) and triggered by pushing a tag.
|
||||||
can be used for generating the entries.
|
can be used for generating the entries.
|
||||||
1. Ensure that any breaking changes are documented in [BREAKING-CHANGES.md](./BREAKING-CHANGES.md)
|
1. Ensure that any breaking changes are documented in [BREAKING-CHANGES.md](./BREAKING-CHANGES.md)
|
||||||
1. Commit and push the changes.
|
1. Commit and push the changes.
|
||||||
1. Create a new tag: `git tag -a v[X.Y.Z]`
|
1. Create a new tag: `git tag -a v[0.x.y]`
|
||||||
1. Push the tag: `git push --tags`
|
1. Push the tag: `git push --tags`
|
||||||
1. Wait for [Continuous Deployment](https://github.com/ratatui/ratatui/actions) workflow to
|
1. Wait for [Continuous Deployment](https://github.com/ratatui/ratatui/actions) workflow to
|
||||||
finish.
|
finish.
|
||||||
|
|
Loading…
Reference in a new issue