diff --git a/.github/scripts/commit-and-tag.cjs b/.github/scripts/commit-and-tag.cjs index 53d63f542..405ebe719 100644 --- a/.github/scripts/commit-and-tag.cjs +++ b/.github/scripts/commit-and-tag.cjs @@ -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 = []; diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cd9cb0368..dfddc44b4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,7 +8,7 @@ name: Build on: push: branches: - - main + # - main - "release/**" tags: - "letro-v*" diff --git a/.github/workflows/release-branch.yaml b/.github/workflows/release-branch.yaml index f0843f717..ca2ba0762 100644 --- a/.github/workflows/release-branch.yaml +++ b/.github/workflows/release-branch.yaml @@ -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)" diff --git a/.github/workflows/release-bump.yaml b/.github/workflows/release-bump.yaml index a2a20791a..06d540daa 100644 --- a/.github/workflows/release-bump.yaml +++ b/.github/workflows/release-bump.yaml @@ -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 diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index c6c394c81..00257a9ef 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -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 diff --git a/LETRO_VERSION b/LETRO_VERSION new file mode 100644 index 000000000..b6ea92554 --- /dev/null +++ b/LETRO_VERSION @@ -0,0 +1 @@ +1.16.0-rc.0