Skip to content

Commit dbeab08

Browse files
authored
feat: add root cwd setting (#36)
1 parent 160b28c commit dbeab08

File tree

12 files changed

+464
-422
lines changed

12 files changed

+464
-422
lines changed

Diff for: .github/workflows/ci.generate.ts

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts";
22

33
enum OperatingSystem {
4-
Mac = "macOS-latest",
4+
Macx86 = "macos-12",
5+
MacArm = "macos-latest",
56
Windows = "windows-latest",
67
Linux = "ubuntu-20.04",
78
}
@@ -13,12 +14,13 @@ interface ProfileData {
1314
}
1415

1516
const profileDataItems: ProfileData[] = [{
16-
os: OperatingSystem.Mac,
17+
os: OperatingSystem.Macx86,
1718
target: "x86_64-apple-darwin",
1819
runTests: true,
1920
}, {
20-
os: OperatingSystem.Mac,
21+
os: OperatingSystem.MacArm,
2122
target: "aarch64-apple-darwin",
23+
runTests: true,
2224
}, {
2325
os: OperatingSystem.Windows,
2426
target: "x86_64-pc-windows-msvc",
@@ -83,7 +85,7 @@ const ci = {
8385
RUST_BACKTRACE: "full",
8486
},
8587
steps: [
86-
{ uses: "actions/checkout@v2" },
88+
{ uses: "actions/checkout@v4" },
8789
{ uses: "dsherret/rust-toolchain-file@v1" },
8890
{
8991
name: "Cache cargo",
@@ -119,11 +121,6 @@ const ci = {
119121
"rustup target add aarch64-unknown-linux-musl",
120122
].join("\n"),
121123
},
122-
{
123-
name: "Setup (Mac aarch64)",
124-
if: "matrix.config.target == 'aarch64-apple-darwin'",
125-
run: "rustup target add aarch64-apple-darwin",
126-
},
127124
{
128125
name: "Build (Debug)",
129126
if: "!startsWith(github.ref, 'refs/tags/')",
@@ -160,7 +157,8 @@ const ci = {
160157
...profiles.map((profile) => {
161158
function getRunSteps() {
162159
switch (profile.os) {
163-
case OperatingSystem.Mac:
160+
case OperatingSystem.MacArm:
161+
case OperatingSystem.Macx86:
164162
return [
165163
`cd target/${profile.target}/release`,
166164
`zip -r ${profile.zipFileName} dprint-plugin-exec`,

Diff for: .github/workflows/ci.yml

+23-10
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
strategy:
2121
matrix:
2222
config:
23-
- os: macOS-latest
23+
- os: macos-12
2424
run_tests: 'true'
2525
target: x86_64-apple-darwin
26-
- os: macOS-latest
27-
run_tests: 'false'
26+
- os: macos-latest
27+
run_tests: 'true'
2828
target: aarch64-apple-darwin
2929
- os: windows-latest
3030
run_tests: 'true'
@@ -53,7 +53,7 @@ jobs:
5353
CARGO_INCREMENTAL: 0
5454
RUST_BACKTRACE: full
5555
steps:
56-
- uses: actions/checkout@v2
56+
- uses: actions/checkout@v4
5757
- uses: dsherret/rust-toolchain-file@v1
5858
- name: Cache cargo
5959
if: 'startsWith(github.ref, ''refs/tags/'') != true'
@@ -78,9 +78,6 @@ jobs:
7878
sudo apt install gcc-aarch64-linux-gnu
7979
sudo apt install musl musl-dev musl-tools
8080
rustup target add aarch64-unknown-linux-musl
81-
- name: Setup (Mac aarch64)
82-
if: matrix.config.target == 'aarch64-apple-darwin'
83-
run: rustup target add aarch64-apple-darwin
8481
- name: Build (Debug)
8582
if: '!startsWith(github.ref, ''refs/tags/'')'
8683
env:
@@ -229,8 +226,6 @@ jobs:
229226
run: 'echo "::set-output name=CHECKSUM::$(shasum -a 256 plugin.json | awk ''{print $1}'')"'
230227
- name: Update Config Schema Version
231228
run: 'sed -i ''s/exec\/0.0.0/exec\/${{ steps.get_tag_version.outputs.TAG_VERSION }}/'' deployment/schema.json'
232-
- name: Create release notes
233-
run: deno run -A ./scripts/generate_release_notes.ts ${{ steps.get_tag_version.outputs.TAG_VERSION }} ${{ steps.get_plugin_file_checksum.outputs.CHECKSUM }} > ${{ github.workspace }}-CHANGELOG.txt
234229
- name: Release
235230
uses: softprops/action-gh-release@v1
236231
env:
@@ -246,5 +241,23 @@ jobs:
246241
dprint-plugin-exec-aarch64-unknown-linux-musl.zip
247242
plugin.json
248243
deployment/schema.json
249-
body_path: ${{ github.workspace }}-CHANGELOG.txt
244+
body: |-
245+
## Install
246+
247+
Dependencies:
248+
249+
- Install dprint's CLI >= 0.40.0
250+
251+
In a dprint configuration file:
252+
253+
1. Specify the plugin url and checksum in the `"plugins"` array or run `dprint config add exec`:
254+
```jsonc
255+
{
256+
// etc...
257+
"plugins": [
258+
"https://plugins.dprint.dev/exec-${{ steps.get_tag_version.outputs.TAG_VERSION }}.json@${{ steps.get_plugin_file_checksum.outputs.CHECKSUM }}"
259+
]
260+
}
261+
```
262+
2. Follow the configuration setup instructions found at https://github.com/dprint/dprint-plugin-exec#configuration
250263
draft: false

Diff for: .github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Clone repository
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
with:
2525
token: ${{ secrets.GH_DPRINTBOT_PAT }}
2626

0 commit comments

Comments
 (0)