Skip to content

Commit b1eec20

Browse files
committed
Merge branch 'develop' into feat/devnet
# Conflicts: # Cargo.lock # Cargo.toml # src/frontend/cli.rs
2 parents 32ccaff + 5ba8b25 commit b1eec20

File tree

20 files changed

+972
-532
lines changed

20 files changed

+972
-532
lines changed

.github/actions/github-release/Dockerfile

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

.github/actions/github-release/README.md

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

.github/actions/github-release/action.yml

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

.github/actions/github-release/main.js

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

.github/actions/github-release/package.json

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

.github/workflows/ci.yaml

Lines changed: 90 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ on:
33
pull_request:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77
paths-ignore:
8-
- '**/CHANGELOG.md'
9-
- '**/package.json'
8+
- "**/CHANGELOG.md"
9+
- "**/package.json"
10+
- "**/Cargo.toml"
11+
- "**/Cargo.lock"
1012
branches:
1113
- main
1214
- develop
@@ -29,7 +31,7 @@ jobs:
2931
steps:
3032
- name: Checkout repository
3133
uses: actions/checkout@v2
32-
34+
3335
- name: Install Rust toolchain
3436
uses: actions-rs/toolchain@v1
3537
with:
@@ -51,7 +53,7 @@ jobs:
5153
run: cargo install cargo-audit
5254

5355
- name: Run audit
54-
run: cargo audit
56+
run: cargo audit --ignore RUSTSEC-2021-0076
5557

5658
- name: Run rustfmt
5759
run: cargo fmt --all -- --check
@@ -179,6 +181,10 @@ jobs:
179181
profile: minimal
180182
override: true
181183

184+
- name: Install wix (Windows)
185+
if: matrix.os == 'windows-latest'
186+
run: cargo install cargo-wix
187+
182188
- if: matrix.os != 'windows-latest'
183189
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
184190

@@ -210,19 +216,73 @@ jobs:
210216
# CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: ${{ matrix.cc }}
211217
# CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: ${{ matrix.cc }}
212218

219+
- name: Code sign bin (Windows)
220+
if: matrix.os == 'windows-latest'
221+
run: |
222+
$certificate_file_name = "${env:TEMP}\certificate.pfx"
223+
224+
$bytes_cert = [Convert]::FromBase64String('${{ secrets.WINDOWS_CODE_SIGNING_CERTIFICATE }}')
225+
[IO.File]::WriteAllBytes(${certificate_file_name}, ${bytes_cert})
226+
227+
$signtool_path = ((Resolve-Path -Path "${env:ProgramFiles(x86)}/Windows Kits/10/bin/10*/x86").Path[-1]) + "/signtool.exe"
228+
$bin_path = (Resolve-Path -Path "target/${{ matrix.target }}/release/*.exe").Path
229+
& ${signtool_path} sign `
230+
/d "Clarinet is a clarity runtime packaged as a command line tool, designed to facilitate smart contract understanding, development, testing and deployment." `
231+
/du "https://github.com/hirosystems/clarinet" `
232+
/tr http://timestamp.digicert.com `
233+
/td sha256 `
234+
/fd sha256 `
235+
-f "${certificate_file_name}" `
236+
-p "${{ secrets.WINDOWS_CODE_SIGNING_PASSWORD }}" `
237+
"${bin_path}"
238+
239+
- name: Build Installer (Windows)
240+
if: matrix.os == 'windows-latest'
241+
run: cargo wix -v --no-build --nocapture
242+
243+
- name: Code sign installer (Windows)
244+
if: matrix.os == 'windows-latest'
245+
run: |
246+
$certificate_file_name = "${env:TEMP}\certificate.pfx"
247+
248+
$bytes_cert = [Convert]::FromBase64String('${{ secrets.WINDOWS_CODE_SIGNING_CERTIFICATE }}')
249+
[IO.File]::WriteAllBytes(${certificate_file_name}, ${bytes_cert})
250+
251+
$signtool_path = ((Resolve-Path -Path "${env:ProgramFiles(x86)}/Windows Kits/10/bin/10*/x86").Path[-1]) + "/signtool.exe"
252+
$msi_path = (Resolve-Path -Path "target/wix/*.msi").Path
253+
& ${signtool_path} sign `
254+
/d "Clarinet is a clarity runtime packaged as a command line tool, designed to facilitate smart contract understanding, development, testing and deployment." `
255+
/du "https://github.com/hirosystems/clarinet" `
256+
/tr http://timestamp.digicert.com `
257+
/td sha256 `
258+
/fd sha256 `
259+
-f "${certificate_file_name}" `
260+
-p "${{ secrets.WINDOWS_CODE_SIGNING_PASSWORD }}" `
261+
"${msi_path}"
262+
263+
# Don't compress for Windows because winget can't yet unzip files
213264
- name: Compress artifact (Not Windows)
214265
if: matrix.os != 'windows-latest'
215-
run: zip --junk-paths ${{ matrix.platform }} ./target/${{ matrix.target }}/release/clarinet
266+
run: zip --junk-paths clarinet-${{ matrix.platform }} ./target/${{ matrix.target }}/release/clarinet
216267

217-
- name: Compress artifact (Windows)
268+
- name: Rename artifact (Windows)
218269
if: matrix.os == 'windows-latest'
219-
run: Compress-Archive -Path ./target/${{ matrix.target }}/release/clarinet.exe -DestinationPath ${{ matrix.platform }}
270+
run: mv target/wix/*.msi clarinet-${{ matrix.platform }}.msi
220271

221-
- name: Upload artifact
272+
# Separate uploads to prevent paths from being preserved
273+
- name: Upload artifact (Not Windows)
274+
if: matrix.os != 'windows-latest'
222275
uses: actions/upload-artifact@v2
223276
with:
224-
name: ${{ matrix.platform }}
225-
path: ${{ matrix.platform }}.zip
277+
name: clarinet-${{ matrix.platform }}
278+
path: clarinet-${{ matrix.platform }}.zip
279+
280+
- name: Upload artifact (Windows)
281+
if: matrix.os == 'windows-latest'
282+
uses: actions/upload-artifact@v2
283+
with:
284+
name: clarinet-${{ matrix.platform }}
285+
path: clarinet-${{ matrix.platform }}.msi
226286

227287
- name: Unit Tests
228288
run: cargo test --release --locked --target ${{ matrix.target }}
@@ -234,20 +294,27 @@ jobs:
234294
./target/${{ matrix.target }}/release/clarinet test --manifest-path examples/${testdir}/Clarinet.toml
235295
done
236296
237-
# - name: Functional Tests (Windows)
238-
# if: matrix.os == 'windows-latest'
239-
# run: |
240-
# foreach($testdir in Get-ChildItem examples) {
241-
# ./target/${{ matrix.target }}/release/clarinet test --manifest-path examples/${testdir}/Clarinet.toml
242-
# }
297+
- name: Functional Tests (Windows)
298+
if: matrix.os == 'windows-latest'
299+
run: |
300+
foreach($testdir in Get-ChildItem examples) {
301+
./target/${{ matrix.target }}/release/clarinet test --manifest-path ${testdir}/Clarinet.toml
302+
}
303+
304+
- name: Upload Artifacts to GH release (Not Windows)
305+
uses: svenstaro/upload-release-action@v2
306+
if: startsWith(github.ref, 'refs/tags/v') && matrix.os != 'windows-latest'
307+
with:
308+
repo_token: ${{ secrets.GITHUB_TOKEN }}
309+
file: clarinet-${{ matrix.platform }}.zip
310+
tag: ${{ github.ref }}
243311

244-
- name: Upload Artifacts to GH release
312+
- name: Upload Artifacts to GH release (Windows)
245313
uses: svenstaro/upload-release-action@v2
246-
if: startsWith(github.ref, 'refs/tags/v')
314+
if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'windows-latest'
247315
with:
248316
repo_token: ${{ secrets.GITHUB_TOKEN }}
249-
file: ${{ matrix.platform }}.zip
250-
asset_name: ${{ matrix.platform }}
317+
file: clarinet-${{ matrix.platform }}.msi
251318
tag: ${{ github.ref }}
252319

253320
# Cleans the `./target` dir after the build such that only dependencies are cached on CI
@@ -268,7 +335,7 @@ jobs:
268335
id: docker_meta
269336
uses: docker/metadata-action@v3
270337
with:
271-
images: blockstack/${{ github.event.repository.name }}
338+
images: ${{ github.repository }}
272339
tags: |
273340
type=ref,event=branch
274341
type=ref,event=pr
@@ -303,7 +370,7 @@ jobs:
303370
uses: actions/checkout@v2
304371
with:
305372
# Necessary for Semantic Release
306-
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
373+
token: ${{ secrets.GH_TOKEN }}
307374

308375
- name: Semantic Release
309376
uses: cycjimmy/semantic-release-action@v2
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
##
2+
## Auto-opens a PR from main -> develop after a release has been published.
3+
##
4+
5+
name: Open Develop PR
6+
7+
on:
8+
release:
9+
types:
10+
- released
11+
workflow_dispatch:
12+
13+
jobs:
14+
run:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Clarinet
18+
uses: actions/checkout@v2
19+
with:
20+
ref: main
21+
22+
- name: Create Pull Request
23+
uses: peter-evans/create-pull-request@v3
24+
with:
25+
token: ${{ secrets.GH_TOKEN }}
26+
base: develop
27+
branch: main
28+
title: "chore: update develop branch"
29+
body: |
30+
:robot: This is an automated pull request created from a new release in [clarinet](https://github.com/hirosystems/clarinet/releases).
31+
32+
Updates the develop branch from main.
33+
assignees: lgalabru
34+
reviewers: lgalabru

0 commit comments

Comments
 (0)