Skip to content

Commit 8bf7ec7

Browse files
Port to Rust (#1)
1 parent bfd13a3 commit 8bf7ec7

30 files changed

Lines changed: 1517 additions & 1517 deletions

.editorconfig

Lines changed: 0 additions & 210 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,28 @@ on:
1111

1212
jobs:
1313
build:
14+
name: ${{ matrix.target }}
15+
1416
strategy:
1517
matrix:
16-
os: [windows-latest, macos-latest]
18+
include:
19+
- target: x86_64-pc-windows-msvc
20+
os: windows-latest
21+
- target: x86_64-apple-darwin
22+
os: macos-13
23+
- target: aarch64-apple-darwin
24+
os: macos-latest
1725

1826
runs-on: ${{ matrix.os }}
1927

2028
steps:
2129
- uses: actions/checkout@v4
22-
- name: Setup .NET
23-
uses: actions/setup-dotnet@v4
30+
- uses: dtolnay/rust-toolchain@master
2431
with:
25-
dotnet-version: 8.0.x
26-
- name: Restore dependencies
27-
run: dotnet restore
32+
toolchain: stable
33+
target: ${{ matrix.target }}
2834
- name: Build
29-
run: dotnet build --no-restore
35+
run:
36+
cargo build --all --target ${{ matrix.target }}
3037
- name: Test
31-
run: dotnet test --no-build --verbosity normal
38+
run: cargo test --all --target ${{ matrix.target }}

.github/workflows/release.yml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a .NET project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3-
41
name: Release
52

63
on:
@@ -9,32 +6,48 @@ on:
96

107
jobs:
118
release:
9+
name: ${{ matrix.target }}
10+
1211
permissions:
1312
contents: write
13+
14+
strategy:
15+
matrix:
16+
include:
17+
- target: x86_64-pc-windows-msvc
18+
os: windows-latest
19+
- target: x86_64-apple-darwin
20+
os: macos-13
21+
- target: aarch64-apple-darwin
22+
os: macos-latest
1423

15-
runs-on: ubuntu-latest
24+
runs-on: ${{ matrix.os }}
1625

1726
steps:
1827
- uses: actions/checkout@v4
19-
- name: Setup .NET
20-
uses: actions/setup-dotnet@v4
28+
- uses: dtolnay/rust-toolchain@master
2129
with:
22-
dotnet-version: 8.0.x
23-
- name: Publish
30+
toolchain: stable
31+
target: ${{ matrix.target }}
32+
- name: Build
2433
run: |
25-
dotnet publish src -r win-x64
26-
dotnet publish src -r osx-x64
27-
dotnet publish src -r osx-arm64
34+
cargo build --release --target ${{ matrix.target }}
35+
36+
if [ "${{ matrix.os }}" = "windows-latest" ]; then
37+
bin="target/${{ matrix.target }}/release/livetagger.exe"
38+
else
39+
bin="target/${{ matrix.target }}/release/livetagger"
40+
fi
41+
42+
echo "BIN=$bin" >> $GITHUB_ENV
2843
- name: Zip artifacts
2944
run: |
3045
tag=$(git describe --tags --abbrev=0)
3146
32-
7z a "livetagger-$tag-win-x64.zip" "./src/bin/Release/net8.0/win-x64/publish/*"
33-
7z a "livetagger-$tag-osx-x64.zip" "./src/bin/Release/net8.0/osx-x64/publish/*"
34-
7z a "livetagger-$tag-osx-arm64.zip" "./src/bin/Release/net8.0/osx-arm64/publish/*"
47+
7z a "livetagger-$tag-$target-x64.zip" $bin
3548
- name: Publish
3649
uses: softprops/action-gh-release@v2
3750
with:
3851
files: "livetagger*"
3952
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)