fix: pin release sources and verify native platform builds
This commit is contained in:
1 parent
500d72a473
commit
260ad39c03
10 files changed
+99
-70
No files matched your search
@@ -230,12 +230,17 @@ jobs:
|
||||
env:
|
||||
PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}"
|
||||
ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
|
||||
RELEASE_COMMIT: "${{ github.sha }}"
|
||||
CHANGELOG: "${{ steps.changelog.outputs.content }}"
|
||||
RELEASE_TAG: "${{ needs.plan.outputs.tag }}"
|
||||
APP_VERSION: "${{ fromJson(steps.host.outputs.manifest).releases[0].app_version }}"
|
||||
PUBLISH_WINGET: "${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}"
|
||||
run: |
|
||||
RELEASE_COMMIT="$(git rev-parse HEAD)"
|
||||
echo "$CHANGELOG" > $RUNNER_TEMP/notes.txt
|
||||
WINGET_MANIFEST_NOTE=""
|
||||
if [[ "$PUBLISH_WINGET" == true ]]; then
|
||||
WINGET_MANIFEST_NOTE="The generated WinGet manifest is attached as \`winget-manifest-${APP_VERSION}.zip\` for local validation."
|
||||
fi
|
||||
cat >> $RUNNER_TEMP/notes.txt <<EOF
|
||||
|
||||
## downloads
|
||||
@@ -271,7 +276,7 @@ jobs:
|
||||
winget install Objz.Rmcl
|
||||
\`\`\`
|
||||
|
||||
The generated WinGet manifest is attached as \`winget-manifest-${APP_VERSION}.zip\` for local validation.
|
||||
$WINGET_MANIFEST_NOTE
|
||||
|
||||
### AUR
|
||||
|
||||
@@ -374,24 +379,3 @@ jobs:
|
||||
secrets: inherit
|
||||
permissions:
|
||||
"contents": "write"
|
||||
|
||||
announce:
|
||||
needs:
|
||||
- plan
|
||||
- host
|
||||
- publish-homebrew-formula
|
||||
- custom-publish-crates
|
||||
- custom-publish-aur
|
||||
- custom-publish-winget
|
||||
# use "always() && ..." to allow us to wait for all publish jobs while
|
||||
# still allowing individual publish jobs to skip themselves (for prereleases).
|
||||
# "host" however must run to completion, no skipping allowed!
|
||||
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') && (needs.custom-publish-crates.result == 'skipped' || needs.custom-publish-crates.result == 'success') && (needs.custom-publish-aur.result == 'skipped' || needs.custom-publish-aur.result == 'success') && (needs.custom-publish-winget.result == 'skipped' || needs.custom-publish-winget.result == 'success') }}
|
||||
runs-on: "ubuntu-22.04"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
@@ -32,22 +32,6 @@ jobs:
|
||||
components: rustfmt
|
||||
- run: cargo fmt --all -- --check
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ inputs.ref || github.sha }}
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "21"
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo clippy --all-targets --locked -- -D warnings
|
||||
|
||||
build-and-test:
|
||||
name: build and test (${{ matrix.os }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -61,6 +45,8 @@ jobs:
|
||||
with:
|
||||
ref: ${{ inputs.ref || github.sha }}
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: temurin
|
||||
@@ -72,6 +58,7 @@ jobs:
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo apt-get update && sudo apt-get install --yes libxcb1-dev
|
||||
- run: cargo build --locked
|
||||
- run: cargo clippy --all-targets --locked -- -D warnings
|
||||
- run: cargo test --locked --all-targets
|
||||
|
||||
network-tests:
|
||||
|
||||
@@ -11,16 +11,27 @@ concurrency:
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
resolve:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
sha: ${{ steps.checkout.outputs.commit }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
id: checkout
|
||||
with:
|
||||
ref: master
|
||||
|
||||
checks:
|
||||
needs: resolve
|
||||
uses: ./.github/workflows/checks.yml
|
||||
with:
|
||||
network-tests: true
|
||||
ref: master
|
||||
ref: ${{ needs.resolve.outputs.sha }}
|
||||
secrets:
|
||||
curseforge-api-key: ${{ secrets.CURSEFORGE_API_KEY }}
|
||||
|
||||
prepare:
|
||||
needs: checks
|
||||
needs: [resolve, checks]
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release: ${{ steps.version.outputs.release }}
|
||||
@@ -28,7 +39,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
ref: master
|
||||
ref: ${{ needs.resolve.outputs.sha }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
|
||||
@@ -39,23 +50,8 @@ jobs:
|
||||
set -euo pipefail
|
||||
|
||||
version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "rmcl") | .version')
|
||||
mapfile -t versions < <(git tag --list 'v*' --sort=-v:refname | sed -nE 's/^v([0-9]+\.[0-9]+\.[0-9]+([-+][0-9A-Za-z.-]+)?)$/\1/p')
|
||||
latest=${versions[0]:-}
|
||||
tag="v${version}"
|
||||
release=false
|
||||
|
||||
if [[ -z "$latest" ]] || [[ "$version" != "$latest" && "$(printf '%s\n%s\n' "$latest" "$version" | sort -V | tail -n1)" == "$version" ]]; then
|
||||
release=true
|
||||
fi
|
||||
|
||||
echo "release=$release" >> "$GITHUB_OUTPUT"
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
|
||||
if [[ "$release" == true ]]; then
|
||||
echo "releasing $tag (latest release: ${latest:-none})"
|
||||
else
|
||||
echo "Cargo.toml version $version is not newer than latest release v$latest; nothing to release"
|
||||
fi
|
||||
python3 scripts/release-version.py --check
|
||||
python3 scripts/release-version.py "$version"
|
||||
|
||||
- name: create tag
|
||||
if: steps.version.outputs.release == 'true'
|
||||
|
||||
Reference in new issue
Block a user