Skip to content

Commit 66f9a4d

Browse files
authored
Release Windows Version (#251)
With LLVM working only minor changes were necessary to get resolc running on Windows. Release in my branch here: https://github.com/paritytech/revive-alex-workflowtest/releases/tag/v0.1.0-dev.12
1 parent 76f4cf7 commit 66f9a4d

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

.github/actions/get-solc/action.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ name: "Install Solidity Compiler"
33
runs:
44
using: "composite"
55
steps:
6-
- name: Put Solc Direcotry into PATH
7-
shell: bash
8-
run: |
9-
mkdir -p solc
10-
echo "$(pwd)/solc/" >> $GITHUB_PATH
11-
126
- name: Figure out Solc Download URL
137
shell: bash
148
run: |
@@ -23,9 +17,19 @@ runs:
2317
- name: Download Solc
2418
shell: bash
2519
run: |
20+
mkdir -p solc
2621
curl -sSL --output solc/solc https://github.com/ethereum/solidity/releases/download/v0.8.28/${SOLC_NAME}
2722
2823
- name: Make Solc Executable
24+
if: ${{ runner.os == 'Windows' }}
25+
shell: bash
26+
run: |
27+
echo "$(pwd -W)\\solc" >> $GITHUB_PATH
28+
mv solc/solc solc/solc.exe
29+
30+
- name: Make Solc Executable
31+
if: ${{ runner.os != 'Windows' }}
2932
shell: bash
3033
run: |
34+
echo "$(pwd)/solc" >> $GITHUB_PATH
3135
chmod +x solc/solc

.github/workflows/release.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
build:
6363
strategy:
6464
matrix:
65-
target: [x86_64-unknown-linux-musl, aarch64-apple-darwin, x86_64-apple-darwin]
65+
target: [x86_64-unknown-linux-musl, aarch64-apple-darwin, x86_64-apple-darwin, x86_64-pc-windows-msvc]
6666
include:
6767
- target: x86_64-unknown-linux-musl
6868
type: musl
@@ -73,6 +73,9 @@ jobs:
7373
- target: x86_64-apple-darwin
7474
type: native
7575
runner: macos-13
76+
- target: x86_64-pc-windows-msvc
77+
type: native
78+
runner: windows-2022
7679
if: ${{ needs.check-version-changed.outputs.TAG == 'new' }}
7780
runs-on: ${{ matrix.runner }}
7881
needs: [check-version-changed]
@@ -91,10 +94,11 @@ jobs:
9194

9295
- name: Build
9396
if: ${{ matrix.type == 'native' }}
97+
shell: bash
9498
run: |
9599
export LLVM_SYS_181_PREFIX=$PWD/llvm-${{ matrix.target }}
96100
make install-bin
97-
mv target/release/resolc resolc-${{ matrix.target }}
101+
mv target/release/resolc resolc-${{ matrix.target }} || mv target/release/resolc.exe resolc-${{ matrix.target }}.exe
98102
99103
- name: Build
100104
if: ${{ matrix.type == 'musl' }}
@@ -113,6 +117,7 @@ jobs:
113117
uses: ./.github/actions/get-solc
114118

115119
- name: Basic Sanity Check
120+
shell: bash
116121
run: |
117122
result=$(./resolc-${{ matrix.target }} --bin crates/integration/contracts/flipper.sol)
118123
echo $result
@@ -121,7 +126,7 @@ jobs:
121126
- uses: actions/upload-artifact@v4
122127
with:
123128
name: resolc-${{ matrix.target }}
124-
path: resolc-${{ matrix.target }}
129+
path: resolc-${{ matrix.target }}*
125130
retention-days: 1
126131

127132
build-wasm:
@@ -209,7 +214,7 @@ jobs:
209214
210215
- uses: actions/upload-artifact@v4
211216
with:
212-
name: resolc-wasm32-unknown-emscripten.tar.gz
217+
name: resolc-wasm32-unknown-emscripten
213218
path: resolc-wasm32-unknown-emscripten.tar.gz
214219
retention-days: 1
215220

@@ -235,15 +240,17 @@ jobs:
235240
chmod +x resolc-universal-apple-darwin
236241
tar -czf resolc-x86_64-unknown-linux-musl.tar.gz resolc-x86_64-unknown-linux-musl
237242
tar -czf resolc-universal-apple-darwin.tar.gz resolc-universal-apple-darwin
243+
zip -j resolc-x86_64-pc-windows-msvc.zip resolc-x86_64-pc-windows-msvc.exe
238244
239245
- name: create-release
240246
uses: softprops/action-gh-release@v2
241247
with:
242248
body: |
243-
${{ needs.tag.outputs.RELEASE_NOTES }}
249+
## Changelog
250+
${{ needs.check-version-changed.outputs.RELEASE_NOTES }}
244251
245-
# Note for macOS Users
246-
The macOS binary is unsigned and it needs to be made runnable using `xattr -c resolc-macos`.
252+
## Note for macOS Users
253+
The macOS binary is unsigned and it needs to be made runnable using `xattr -c resolc-universal-apple-darwin`.
247254
tag_name: ${{ needs.check-version-changed.outputs.PKG_VER }}
248255
name: ${{ needs.check-version-changed.outputs.PKG_VER }}
249256
draft: true
@@ -252,3 +259,4 @@ jobs:
252259
resolc-x86_64-unknown-linux-musl.tar.gz
253260
resolc-universal-apple-darwin.tar.gz
254261
resolc-wasm32-unknown-emscripten.tar.gz
262+
resolc-x86_64-pc-windows-msvc.zip

crates/lld-sys/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn main() {
9696
revive_build_utils::llvm_cxx_flags()
9797
.split_whitespace()
9898
.fold(&mut cc::Build::new(), |builder, flag| builder.flag(flag))
99-
.flag("-Wno-unused-parameter")
99+
.warnings(false)
100100
.cpp(true)
101101
.file("src/linker.cpp")
102102
.compile("liblinker.a");

0 commit comments

Comments
 (0)