Skip to content

Commit 4db8586

Browse files
committed
Fix language
1 parent 484cf0a commit 4db8586

File tree

5 files changed

+36
-39
lines changed

5 files changed

+36
-39
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: rust
1+
name: ci
22
on:
33
push:
44
branches:
@@ -10,6 +10,8 @@ on:
1010
- main
1111
- develop
1212
- release/*
13+
schedule:
14+
- cron: '0 0 * * 0'
1315

1416
jobs:
1517
build-and-validate:

.github/workflows/deploy.yml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- "v*"
77

88
workflow_run:
9-
workflows: ["Tag on Merge to Master"]
9+
workflows: ["Tag on Merge to Main"]
1010
types:
1111
- completed
1212

@@ -21,12 +21,12 @@ jobs:
2121
outputs:
2222
tag_name: ${{ steps.get_tag.outputs.tag }}
2323
steps:
24-
- name: Récupérer le dernier tag via l'API GitHub
24+
- name: Retrieve the latest tag via the GitHub API
2525
id: get_tag
2626
run: |
2727
LATEST_TAG=$(gh api repos/${{ github.repository }}/git/matching-refs/tags/v --jq '.[-1].ref' | sed 's|refs/tags/||')
2828
if [[ -z "$LATEST_TAG" ]]; then
29-
echo "Aucun tag trouvé. Arrêt du workflow."
29+
echo "No tag found. Stopping workflow."
3030
exit 1
3131
fi
3232
echo "tag=$LATEST_TAG" >> "$GITHUB_OUTPUT"
@@ -39,88 +39,86 @@ jobs:
3939
env:
4040
CARGO_TERM_COLOR: always
4141
RUSTFLAGS: -D warnings
42-
# Définition du tag selon l'événement déclencheur
42+
# Define the tag based on the triggering event
4343
TAG_NAME: ${{ github.event_name == 'push' && github.ref_name || needs.determine-tag.outputs.tag_name }}
4444

4545
steps:
46-
- name: Récupérer le code du dépôt
46+
- name: Checkout repository
4747
uses: actions/checkout@v4
4848

49-
- name: Mise en cache du Cargo Registry
49+
- name: Cache Cargo Registry
5050
uses: actions/cache@v3
5151
with:
5252
path: ~/.cargo/registry
5353
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
5454
restore-keys: ${{ runner.os }}-cargo-registry-
5555

56-
- name: Mise en cache du Cargo Git Index
56+
- name: Cache Cargo Git Index
5757
uses: actions/cache@v3
5858
with:
5959
path: ~/.cargo/git
6060
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
6161
restore-keys: ${{ runner.os }}-cargo-index-
6262

63-
- name: Installer Rust
63+
- name: Install Rust
6464
shell: pwsh
6565
run: rustup update stable && rustup default stable
6666

67-
- name: Installer PSSemVer
67+
- name: Install PSSemVer
6868
shell: pwsh
6969
run: |
7070
try {
7171
Import-Module -Name PSSemVer -ErrorAction Stop
7272
} catch {
73-
Write-Host "Installation du module PSSemVer..."
73+
Write-Host "Installing PSSemVer module..."
7474
Install-Module -Name PSSemVer -Scope CurrentUser -Force -ErrorAction Stop
7575
Import-Module -Name PSSemVer -ErrorAction Stop
7676
}
7777
78-
- name: Valider le tag avec PSSemVer
78+
- name: Validate tag with PSSemVer
7979
id: validate
8080
shell: pwsh
8181
run: |
82-
# Récupérer le nom du tag en supprimant le préfixe "v"
82+
# Extract the tag name by removing the "v" prefix
8383
$tagName = "${{ env.TAG_NAME }}"
8484
Import-Module -Name PSSemVer -ErrorAction Stop
8585
try {
8686
$rawVersion = $tagName -replace '^v', ''
8787
$Version = [PSSemVer]::Parse($rawVersion)
8888
89-
# Convertir le booléen indiquant si la version est prerelease en chaîne en minuscules
89+
# Convert the prerelease boolean to lowercase string
9090
$prereleaseValue = ($Version.Prerelease -ne $null).ToString().ToLower()
9191
echo "prerelease=$prereleaseValue" >> $env:GITHUB_ENV
9292
93-
# Vérifier le champ metadata pour la version NuGet
93+
# Check the metadata field for the NuGet version
9494
if (-not [string]::IsNullOrEmpty($Version.BuildMetadata)) {
9595
echo "nuget_version=$($Version.BuildMetadata)" >> $env:GITHUB_ENV
9696
} else {
97-
Write-Host "Aucune métadonnée trouvée dans le tag. Utilisation de la version sans métadonnée pour NuGet."
97+
Write-Host "No metadata found in the tag. Using the version without metadata for NuGet."
9898
echo "nuget_version=$rawVersion" >> $env:GITHUB_ENV
9999
}
100100
} catch {
101-
Write-Error "Le nom du tag ne contient pas une version sémantique valide. Tag actuel : $tagName"
101+
Write-Error "The tag name does not contain a valid semantic version. Current tag: $tagName"
102102
exit 1
103103
}
104104
continue-on-error: false
105105

106-
- name: Exécuter Cargo Publish en mode Dry-Run
106+
- name: Run Cargo Publish in Dry-Run Mode
107107
run: cargo publish --dry-run
108108

109-
- name: Créer une Release GitHub
109+
- name: Create GitHub Release
110110
id: release
111111
uses: softprops/action-gh-release@v2
112112
with:
113113
tag_name: ${{ env.TAG_NAME }}
114114
name: ${{ env.prerelease == 'true' && 'Prerelease' || 'Release' }} ${{ env.TAG_NAME }}
115115
body: |
116-
Ceci est une ${{ env.prerelease == 'true' && 'prerelease' || 'release' }} de la crate.
117-
Vous pouvez retrouver la [crate ici](https://crates.io/crates/${{ github.repository }}).
118-
Cette version est un binding pour le WSLPluginAPI v${{ env.nuget_version }} disponible sur [NuGet](https://www.nuget.org/packages/Microsoft.WSL.PluginApi/${{ env.nuget_version }}).
116+
This is a **${{ env.prerelease == 'true' && 'prerelease' || 'release' }}** of **${{ github.repository }}**.
117+
- The crate is available on [Crates.io](https://crates.io/crates/${{ github.repository }}).
118+
- This version provides bindings for **WSLPluginAPI v${{ env.nuget_version }}**, which can be found on [NuGet](https://www.nuget.org/packages/Microsoft.WSL.PluginApi/${{ env.nuget_version }}).
119119
prerelease: ${{ env.prerelease == 'true' }}
120-
env:
121-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
122120

123-
- name: Publier sur Cargo
121+
- name: Cargo Publish Cargo
124122
run: cargo publish
125123
env:
126124
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/release-checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: Release Checks
12
on:
23
push:
34
branches:

.github/workflows/release-tag.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tag on Merge to Master
1+
name: Tag on Merge to Main
22

33
on:
44
pull_request:
@@ -13,9 +13,7 @@ permissions:
1313
jobs:
1414
create-tag:
1515
if: ${{ github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') }}
16-
runs-on: windows-latest
17-
env:
18-
CARGO_TERM_COLOR: always
16+
runs-on: ubuntu-latest
1917

2018
steps:
2119
- name: Checkout Repository
@@ -25,20 +23,18 @@ jobs:
2523

2624
- name: Extract Version from Branch Name
2725
id: extract_version
28-
shell: pwsh
26+
shell: bash
2927
run: |
30-
$branchName = "${{ github.event.pull_request.head.ref }}"
31-
$version = $branchName -replace '^release/', ''
32-
Write-Host "Extracted version: $version"
33-
echo "version=$version" >> $env:GITHUB_ENV
28+
branch_name="${GITHUB_HEAD_REF}"
29+
version="${branch_name#release/}"
30+
echo "Extracted version: $version"
31+
echo "version=$version" >> $GITHUB_ENV
3432
3533
- name: Create Git Tag
36-
id: create_tag
37-
shell: pwsh
3834
run: |
3935
git config user.name "GitHub Actions"
4036
git config user.email "actions@github.com"
41-
git tag "v${{ env.version }}" -a -m "Release version $env:version"
37+
git tag "v${{ env.version }}" -a -m "Release version ${{ env.version }}"
4238
git push origin "v${{ env.version }}"
4339
env:
44-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Docs.rs](https://img.shields.io/badge/docs.rs-wslpluginapi--sys-blue?logo=docs.rs)](https://docs.rs/wslpluginapi-sys)
55
[![Build Status](https://github.com/mveril/wslpluginapi-sys/actions/workflows/ci.yml/badge.svg?logo=github)](https://github.com/mveril/wslpluginapi-sys/actions)
66
[![License](https://img.shields.io/badge/license-MIT-blue.svg?logo=license)](LICENSE)
7-
![Native API version](https://img.shields.io/badge/Microsoft.WSL.PluginApi-2.3.1-blue?logo=nuget&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.WSL.PluginApi%2F2.1.3)
7+
[![Native API version](https://img.shields.io/badge/Microsoft.WSL.PluginApi-2.1.3-blue?logo=nuget)](https://www.nuget.org/packages/Microsoft.WSL.PluginApi/2.1.3)
88
[![Platform](https://img.shields.io/badge/platform-Windows-blue?logo=windows&logoColor=white)](#)
99

1010
`wslpluginapi-sys` is a Rust crate that provides low-level bindings to the Windows Subsystem for Linux (WSL) Plugin API. It offers a direct interface to the functions and structures defined in the WSL Plugin API, facilitating the development of WSL plugins in Rust.

0 commit comments

Comments
 (0)