Skip to content

Commit 321027f

Browse files
committed
Revert "Release 0.1-beta.1+2.1.3"
This reverts commit fd4df8f.
1 parent fd4df8f commit 321027f

File tree

6 files changed

+66
-137
lines changed

6 files changed

+66
-137
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,12 @@ jobs:
4949
id: validate
5050
shell: pwsh
5151
run: |
52-
# Récupère le nom du tag en supprimant le préfixe "v"
5352
$tagName = "${{ github.ref_name }}"
54-
Import-Module -Name PSSemVer -ErrorAction Stop
5553
try {
5654
$rawVersion = $tagName -replace '^v', ''
5755
$Version = [PSSemVer]::Parse($rawVersion)
58-
59-
# Forcer le booléen à une chaîne en minuscules
60-
$prereleaseValue = ($Version.Prerelease -ne $null).ToString().ToLower()
61-
echo "prerelease=$prereleaseValue" >> $env:GITHUB_ENV
62-
63-
# Vérifier que le champ metadata est renseigné pour la version NuGet
64-
if (-not [string]::IsNullOrEmpty($Version.metadata)) {
65-
echo "nuget_version=$($Version.metadata)" >> $env:GITHUB_ENV
66-
} else {
67-
Write-Error "Metadata is empty. Cannot determine NuGet version."
68-
exit 1
69-
}
56+
echo "prerelease=$($Version.Prerelease -ne $null)" >> $env:GITHUB_ENV
57+
echo "nuget_version=$($Version.metadata)" >> $env:GITHUB_ENV
7058
} catch {
7159
Write-Error "Tag name does not contain a valid semantic version. Current tag: $tagName"
7260
exit 1

.github/workflows/release-checks.yml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,68 +30,77 @@ jobs:
3030
- name: Cache PowerShell Modules
3131
uses: actions/cache@v3
3232
with:
33-
path: C:\Users\runneradmin\Documents\PowerShell\Modules
33+
path: |
34+
$env:USERPROFILE\Documents\WindowsPowerShell\Modules
3435
key: ${{ runner.os }}-powershell-modules
3536
restore-keys: ${{ runner.os }}-powershell-modules-
3637

3738
- name: Install Rust
3839
shell: pwsh
39-
run: |
40-
rustup update stable
41-
rustup default stable
40+
run: rustup update stable && rustup default stable
4241

4342
- name: Install PSSemVer
4443
shell: pwsh
4544
run: |
46-
if (-not (Get-Module -ListAvailable -Name PSSemVer)) {
45+
try {
46+
Import-Module -Name PSSemVer -ErrorAction Stop
47+
} catch {
48+
Write-Host "Installing PSSemVer module..."
4749
Install-Module -Name PSSemVer -Scope CurrentUser -Force -ErrorAction Stop
50+
Import-Module -Name PSSemVer -ErrorAction Stop
4851
}
49-
Import-Module -Name PSSemVer -ErrorAction Stop
5052
5153
- name: Extract Branch Version
5254
id: extract_version
5355
shell: pwsh
5456
run: |
5557
$branchName = "${{ github.ref_name }}"
56-
$rawVersion = $branchName -replace '^release/', ''
57-
Import-Module -Name PSSemVer -ErrorAction Stop
5858
try {
59+
$rawVersion = $branchName -replace '^release/', ''
5960
$expectedVersion = [PSSemVer]::Parse($rawVersion)
61+
62+
Write-Output "expected_version=$expectedVersion" | Out-File -FilePath $GITHUB_OUTPUT -Encoding utf8
63+
Write-Host "Expected version for crates: $expectedVersion"
6064
} catch {
61-
Write-Error "❌ ERROR: Failed to parse '$rawVersion' as a valid SemVer version."
65+
Write-Error "Branch name does not contain a valid semantic version. Current branch: $branchName"
6266
exit 1
6367
}
64-
echo "EXPECTED_VERSION=$expectedVersion" >> $env:GITHUB_ENV
6568
6669
- name: Parse and Compare Crate Versions
6770
shell: pwsh
71+
env:
72+
EXPECTED_VERSION: ${{ steps.extract_version.outputs.expected_version }}
6873
run: |
69-
Import-Module -Name PSSemVer -ErrorAction Stop
7074
try {
7175
$expectedSemVer = [PSSemVer]::Parse($env:EXPECTED_VERSION)
7276
} catch {
73-
Write-Error "❌ ERROR: Expected version '$env:EXPECTED_VERSION' is not a valid semantic version."
77+
Write-Error "Expected version '$env:EXPECTED_VERSION' is not a valid semantic version."
7478
exit 1
7579
}
7680
81+
# Retrieve package version using cargo pkgid
7782
$pkgid = cargo pkgid --quiet
78-
if ($pkgid -match "#(.+)$") {
83+
if ($pkgid -match "#([\d\.]+)") {
7984
$currentVersion = $matches[1]
8085
} else {
81-
Write-Error "❌ ERROR: Failed to extract version from cargo pkgid output: $pkgid"
86+
Write-Error "Failed to extract version from cargo pkgid output: $pkgid"
8287
exit 1
8388
}
8489
90+
Write-Host "Current crate version: $currentVersion"
91+
8592
try {
8693
$currentSemVer = [PSSemVer]::Parse($currentVersion)
8794
} catch {
88-
Write-Error "❌ ERROR: Current version '$currentVersion' is not a valid semantic version."
95+
Write-Error "Current version '$currentVersion' is not a valid semantic version."
8996
exit 1
9097
}
9198
9299
if ($currentSemVer.CompareTo($expectedSemVer) -ne 0) {
93-
Write-Error "ERROR: Crate version '$currentSemVer' does not match expected '$expectedSemVer'."
100+
Write-Error "ERROR: Crate version '$currentSemVer' does not match expected '$expectedSemVer'."
94101
exit 1
102+
} else {
103+
Write-Host "Crate version '$currentSemVer' matches the branch version."
95104
}
96105
97106
publish-dry-run:
@@ -117,18 +126,18 @@ jobs:
117126

118127
- name: Install Rust
119128
shell: pwsh
120-
run: |
121-
rustup update stable
122-
rustup default stable
129+
run: rustup update stable && rustup default stable
123130

124131
- name: Run Tests
125132
shell: pwsh
126133
run: |
134+
echo "Running tests..."
127135
cargo test --all-targets
128136
129137
- name: Publish Dry-Run
130138
env:
131139
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
132140
shell: pwsh
133141
run: |
142+
echo "Running cargo publish dry-run..."
134143
cargo publish --dry-run

.github/workflows/release-tag.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,20 @@ jobs:
2525
$branchName = "${{ github.event.pull_request.head.ref }}"
2626
$version = $branchName -replace '^release/', ''
2727
Write-Host "Extracted version: $version"
28-
echo "version=$version" >> $env:GITHUB_ENV
28+
echo "version=$version" >> $GITHUB_ENV
2929
3030
- name: Create Git Tag
3131
id: create_tag
32-
shell: pwsh
3332
run: |
3433
git config user.name "GitHub Actions"
3534
git config user.email "actions@github.com"
36-
git tag "v${{ env.version }}" -a -m "Release version $env:version"
35+
git tag "v${{ env.version }}" -a -m "Release version ${{ env.version }}"
3736
git push origin "v${{ env.version }}"
3837
3938
- name: Verify Tag
40-
shell: pwsh
4139
run: |
4240
git fetch --tags
43-
if (-not (git tag | Select-String "v${{ env.version }}")) {
44-
Write-Host "Tag creation failed for version $env:version."
41+
if (! git tag | grep -q "v${{ env.version }}") {
42+
echo "Tag creation failed for version ${{ env.version }}."
4543
exit 1
4644
}

0 commit comments

Comments
 (0)