Skip to content

Commit 66c5480

Browse files
Merge pull request #12 from ChrisTitusTech/F#
Fix CI/CD for F# instead of Rust
2 parents 4bfa740 + 20137d4 commit 66c5480

5 files changed

Lines changed: 76 additions & 83 deletions

File tree

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "cargo"
4-
directory: "/"
5-
schedule:
6-
interval: "weekly"
73
- package-ecosystem: "github-actions"
84
directory: "/"
95
schedule:

.github/workflows/Release.yml

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,52 @@ permissions:
77
contents: write
88
packages: write
99

10-
env:
11-
CARGO_TERM_COLOR: always
12-
1310
jobs:
1411
macutil_build:
1512
runs-on: ubuntu-latest
1613

1714
steps:
1815
- uses: actions/checkout@v4
1916

20-
- name: Install musl-tools
21-
run: sudo apt-get update && sudo apt-get install musl-tools
22-
23-
- name: Cache Cargo registry
24-
uses: actions/cache@v4
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
2519
with:
26-
path: ~/.cargo/registry
27-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
28-
restore-keys: ${{ runner.os }}-cargo-registry-
20+
dotnet-version: '9.0.x'
2921

30-
- name: Cache Cargo index
22+
- name: Cache .NET packages
3123
uses: actions/cache@v4
3224
with:
33-
path: ~/.cargo/git
34-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
35-
restore-keys: ${{ runner.os }}-cargo-index-
25+
path: ~/.nuget/packages
26+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
27+
restore-keys: ${{ runner.os }}-nuget-
3628

37-
- name: Install Rust
38-
uses: dtolnay/rust-toolchain@stable
39-
with:
40-
targets: x86_64-unknown-linux-musl
29+
- name: Restore dependencies
30+
run: dotnet restore MacUtilGUI/MacUtilGUI.fsproj
4131

42-
- name: Install cross-rs for cross-compilation
43-
run: cargo install cross
32+
- name: Build and publish macOS x64
33+
run: |
34+
dotnet publish MacUtilGUI/MacUtilGUI.fsproj \
35+
--configuration Release \
36+
--runtime osx-x64 \
37+
--self-contained true \
38+
--output ./build/osx-x64 \
39+
/p:PublishSingleFile=true \
40+
/p:IncludeNativeLibrariesForSelfExtract=true
4441
45-
- name: Build x86_64 binary
46-
run: cargo build --target-dir=build --release --verbose --target=x86_64-unknown-linux-musl --all-features
42+
- name: Build and publish macOS ARM64
43+
run: |
44+
dotnet publish MacUtilGUI/MacUtilGUI.fsproj \
45+
--configuration Release \
46+
--runtime osx-arm64 \
47+
--self-contained true \
48+
--output ./build/osx-arm64 \
49+
/p:PublishSingleFile=true \
50+
/p:IncludeNativeLibrariesForSelfExtract=true
4751
48-
- name: Build aarch64 binary
52+
- name: Rename binaries
4953
run: |
50-
cross build --target-dir=build --release --verbose --target=aarch64-unknown-linux-musl --all-features
51-
mv ./build/aarch64-unknown-linux-musl/release/macutil ./build/aarch64-unknown-linux-musl/release/macutil-aarch64
54+
mv ./build/osx-x64/MacUtilGUI ./build/osx-x64/macutil-macos-x64
55+
mv ./build/osx-arm64/MacUtilGUI ./build/osx-arm64/macutil-macos-arm64
5256
5357
- name: Extract Version
5458
id: extract_version
@@ -64,16 +68,14 @@ jobs:
6468
tag_name: ${{ env.version }}
6569
name: Pre-Release ${{ env.version }}
6670
body: |
67-
![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/macutil/${{ env.version }}/macutil)
68-
![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/macutil/${{ env.version }}/macutil-aarch64)
71+
![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/macutil/${{ env.version }}/macutil-macos-x64)
72+
![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/macutil/${{ env.version }}/macutil-macos-arm64)
6973
7074
append_body: true
7175
generate_release_notes: true
7276
files: |
73-
./build/x86_64-unknown-linux-musl/release/macutil
74-
./build/aarch64-unknown-linux-musl/release/macutil-aarch64
75-
./start.sh
76-
./startdev.sh
77+
./build/osx-x64/macutil-macos-x64
78+
./build/osx-arm64/macutil-macos-arm64
7779
prerelease: true
7880
env:
7981
version: ${{ env.version }}

.github/workflows/fsharp.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: F# Checks
2+
3+
on:
4+
pull_request:
5+
branches: ["main"]
6+
paths:
7+
- '**/*.fs'
8+
- '**/*.fsproj'
9+
- 'MacUtilGUI/**'
10+
11+
jobs:
12+
lints:
13+
name: F# Build and Format Check
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout sources
18+
uses: actions/checkout@v4
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: '9.0.x'
24+
25+
- name: Cache .NET packages
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.nuget/packages
29+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
30+
restore-keys: ${{ runner.os }}-nuget-
31+
32+
- name: Restore dependencies
33+
run: dotnet restore MacUtilGUI/MacUtilGUI.fsproj
34+
35+
- name: Build project
36+
run: dotnet build MacUtilGUI/MacUtilGUI.fsproj --configuration Release --no-restore
37+
38+
- name: Check F# formatting
39+
run: dotnet fantomas --check MacUtilGUI/

.github/workflows/preview.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ jobs:
6262
6363
- name: Download binary
6464
run: |
65-
curl -LO "https://github.com/${{ github.repository }}/releases/download/${{ steps.final_tag.outputs.tag_name }}/macutil"
65+
curl -LO "https://github.com/${{ github.repository }}/releases/download/${{ steps.final_tag.outputs.tag_name }}/macutil-macos-arm64"
6666
6767
- name: Set env
6868
id: branch_setup
6969
run: |
70-
chmod +x macutil
70+
chmod +x macutil-macos-arm64
7171
mkdir -p build
72-
mv macutil build/macutil
72+
mv macutil-macos-arm64 build/macutil
7373
echo "${{ github.workspace }}/build" >> $GITHUB_PATH
7474
branch_name=$(echo "${{ steps.final_tag.outputs.tag_name }}" | tr . -)
7575
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT

.github/workflows/rust.yml

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

0 commit comments

Comments
 (0)