separate letro relese workflows

This commit is contained in:
Letro Bot
2026-04-26 14:13:05 +03:30
parent b740f24e71
commit 733e21b366
6 changed files with 7 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ module.exports = async ({ github, context }) => {
const parent = context.sha;
if (!version) throw new Error("VERSION is not defined");
const files = ["Cargo.toml", "Cargo.lock"];
const files = ["LETRO_VERSION"];
/** @type {{path: string, mode: "100644", type: "blob", sha: string}[]} */
const tree = [];

View File

@@ -8,7 +8,7 @@ name: Build
on:
push:
branches:
- main
# - main
- "release/**"
tags:
- "letro-v*"

View File

@@ -36,15 +36,12 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Compute the new minor RC
id: next
env:
BUMP: pre${{ inputs.kind }}
run: |
CURRENT_VERSION="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "mas-cli") | .version')"
CURRENT_VERSION="$(cat LETRO_VERSION | tr -d '[:space:]')"
NEXT_VERSION="$(npx --yes semver@7.5.4 -i "$BUMP" --preid rc "${CURRENT_VERSION}")"
# compute the short minor version, e.g. 0.1.0-rc.1 -> 0.1
SHORT_VERSION="$(echo "${NEXT_VERSION}" | cut -d. -f1-2)"

View File

@@ -35,12 +35,9 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Extract the current version
id: current
run: echo "version=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "mas-cli") | .version')" >> "$GITHUB_OUTPUT"
run: echo "version=$(cat LETRO_VERSION | tr -d '[:space:]')" >> "$GITHUB_OUTPUT"
- name: Compute the new minor RC
id: next

View File

@@ -32,18 +32,10 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set the crates version
- name: Set the fork version
env:
VERSION: ${{ inputs.version }}
run: |
sed -i "s/^package.version = .*/package.version = \"$VERSION\"/" Cargo.toml
sed -i "/path = \".\/crates\//s/version = \".*\"/version = \"=$VERSION\"/" Cargo.toml
- name: Run `cargo metadata` to make sure the lockfile is up to date
run: cargo metadata --format-version 1
run: echo "$VERSION" > LETRO_VERSION
- name: Commit and tag using the GitHub API
uses: actions/github-script@v8.0.0