Skip to content

Commit a8edb0b

Browse files
committed
Version: 5.0.0-rc.2
Setting MSRV to 1.88.0 because it introduced stable support for multiple let expressions inside if conditions. Also using cache in CI/CD for Cargo cache and target/. Now including tests with excluded test during deployment.
1 parent 3c451a3 commit a8edb0b

5 files changed

Lines changed: 88 additions & 34 deletions

File tree

.github/workflows/data/release-notes.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ Summary
77

88
### Downloads
99

10-
Pre-compiled binaries are available for multiple targets, each archive contains the CLI
11-
executable, the dynamic library and the development files: headers, debug symbols and
12-
static library.
10+
Pre-compiled binaries are available for multiple targets, each archive contains the CLI executable, ~~the dynamic library and the development files: headers, debug symbols and static library~~ (will be available later).

.github/workflows/deploy.yml

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
id: get-version
2828
shell: bash
2929
run: echo "version=$(cargo pkgid -p portablemc | awk -F'[#@]' '{print $NF}')" >> $GITHUB_OUTPUT
30-
30+
3131
# We only check the cargo version if we are running the workflow against a tag.
3232
check-version:
3333
name: Check version against tag
@@ -39,10 +39,24 @@ jobs:
3939
- name: Match cargo version with tag
4040
shell: bash
4141
run: test "v${{ needs.fetch-version.outputs.version }}" = "${{ github.ref_name }}"
42-
43-
# We only build when the current cargo version has been checked OR we have manually
44-
# dispatched the workflow!
42+
43+
# Include the other test workflow but trigger it, including ignored tests!
44+
# Always running all tests, even if check version is skipped (due to the workflow not
45+
# being dispatched on a tag).
46+
test-all:
47+
name: Test all
48+
needs: check-version
49+
if: ${{ always() && (needs.check-version.result == 'success' || needs.check-version.result == 'skipped') }}
50+
uses: ./.github/workflows/test.yml
51+
with:
52+
include-ignored: true
53+
54+
# We only build if all test passed.
4555
build:
56+
name: Build ${{ matrix.target }} on ${{ matrix.image }}
57+
needs: test-all
58+
runs-on: ${{ matrix.image }}
59+
4660
strategy:
4761
fail-fast: false
4862
matrix:
@@ -92,13 +106,23 @@ jobs:
92106
echo 'OPENSSL_LIB_DIR=/usr/lib/arm-linux-gnueabihf' >> $GITHUB_ENV
93107
echo 'CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=/usr/bin/arm-linux-gnueabihf-gcc' >> $GITHUB_ENV
94108
95-
name: Build ${{ matrix.target }} on ${{ matrix.image }}
96-
needs: check-version # Note that this already depends on github.ref being a tag...
97-
if: ${{ always() && (github.event_name == 'workflow_dispatch' || (needs.check-version.result == 'success' && !contains(github.ref, '-beta') && !contains(github.ref, '-alpha'))) }}
98-
runs-on: ${{ matrix.image }}
99109
steps:
100110

101111
- uses: actions/checkout@v4
112+
113+
- name: Cache cargo registry
114+
uses: actions/cache@v4
115+
with:
116+
path: |
117+
~/.cargo/registry
118+
~/.cargo/git
119+
key: cargo-registry
120+
121+
- name: Cache cargo target
122+
uses: actions/cache@v4
123+
with:
124+
path: target
125+
key: cargo-${{ matrix.image }}-${{ hashFiles('**/Cargo.lock') }}
102126

103127
- name: Setup
104128
if: matrix.setup != null
@@ -159,11 +183,14 @@ jobs:
159183
name: ${{ matrix.target }}
160184
path: ~/portablemc/
161185

186+
# We only create a release if it's a tag AND if it's not a beta or alpha tag.
162187
release:
163188
name: Release
164189
needs:
165190
- fetch-version
166-
- build # This requires that github.ref is a tag and not of beta/alpha
191+
- check-version # This requires that the workflow is dispatched on a tag!
192+
- build
193+
if: ${{ !contains(github.ref, '-beta') && !contains(github.ref, '-alpha') }}
167194
runs-on: ubuntu-latest
168195
steps:
169196

@@ -194,16 +221,31 @@ jobs:
194221
shell: bash
195222
run: gh release create ${{ github.ref_name }} --verify-tag --draft --title "Version ${{ needs.fetch-version.outputs.version }}" --notes-file .github/workflows/data/release-notes.md ~/artifacts/*.zip
196223

224+
# We always publish anyway if the full test + build succeeds.
197225
publish:
198226
name: Publish
199-
needs: check-version # This checks that github.ref is a tag
200-
runs-on: ubuntu-latest
227+
needs: build
228+
runs-on: ubuntu-24.04
201229
steps:
202230

203231
- uses: actions/checkout@v4
204232

233+
- name: Cache cargo registry
234+
uses: actions/cache@v4
235+
with:
236+
path: |
237+
~/.cargo/registry
238+
~/.cargo/git
239+
key: cargo-registry
240+
241+
- name: Cache cargo target
242+
uses: actions/cache@v4
243+
with:
244+
path: target
245+
key: cargo-ubuntu-24.04-${{ hashFiles('**/Cargo.lock') }}
246+
205247
- name: Publish API
206-
run: cargo publish -p portablemc
248+
run: cargo publish --no-verify -p portablemc
207249

208250
- name: Publish CLI
209-
run: cargo publish -p portablemc-cli
251+
run: cargo publish --no-verify -p portablemc-cli

.github/workflows/test.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,18 @@ on:
1515
- README.md
1616
- LICENSE
1717
- doc/**
18+
workflow_call:
19+
inputs:
20+
include-ignored:
21+
description: Set to true to include all ignored test, this will be longer
22+
type: boolean
23+
default: false
1824

1925
env:
2026
CARGO_TERM_COLOR: always
2127

2228
jobs:
2329

24-
# No longer checking lock because the lock version could be intentionally set
25-
# check-lock:
26-
# name: Check lock
27-
# runs-on: ubuntu-latest
28-
# steps:
29-
30-
# - uses: actions/checkout@v4
31-
32-
# - name: Check lock
33-
# run: cargo update --locked
34-
3530
test:
3631
strategy:
3732
fail-fast: false
@@ -51,12 +46,31 @@ jobs:
5146
steps:
5247

5348
- uses: actions/checkout@v4
49+
50+
- name: Cache cargo registry
51+
uses: actions/cache@v4
52+
with:
53+
path: |
54+
~/.cargo/registry
55+
~/.cargo/git
56+
key: cargo-registry
57+
58+
- name: Cache cargo target
59+
uses: actions/cache@v4
60+
with:
61+
path: target
62+
key: cargo-${{ matrix.image }}-${{ hashFiles('**/Cargo.lock') }}
5463

5564
- name: Build
5665
run: cargo build
5766

5867
- name: Test
68+
if: ${{ !inputs.include-ignored }}
5969
run: cargo test
6070

71+
- name: Test (include ignored)
72+
if: ${{ inputs.include-ignored }}
73+
run: cargo test -- --include-ignored
74+
6175
- name: Doc
6276
run: cargo doc --no-deps

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ resolver = "2"
55

66
[workspace.package]
77
edition = "2024"
8-
version = "5.0.0-rc.1"
8+
version = "5.0.0-rc.2"
99
authors = ["Théo Rozier <contact@theorozier.fr>"]
1010
homepage = "https://github.com/mindstorm38/portablemc"
1111
repository = "https://github.com/mindstorm38/portablemc"
1212
license = "Apache-2.0"
1313
readme = "README.md"
14-
rust-version = "1.85.1"
14+
rust-version = "1.88.0"
1515

1616
[workspace.dependencies]
17-
portablemc = { path = "portablemc", version = "=5.0.0-rc.1" }
17+
portablemc = { path = "portablemc", version = "=5.0.0-rc.2" }
1818

1919
# Utils
2020
thiserror = "2.0.3"

0 commit comments

Comments
 (0)