Skip to content

Commit

Permalink
feat: add root cwd setting (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Jul 11, 2024
1 parent 160b28c commit dbeab08
Show file tree
Hide file tree
Showing 12 changed files with 464 additions and 422 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts";

enum OperatingSystem {
Mac = "macOS-latest",
Macx86 = "macos-12",
MacArm = "macos-latest",
Windows = "windows-latest",
Linux = "ubuntu-20.04",
}
Expand All @@ -13,12 +14,13 @@ interface ProfileData {
}

const profileDataItems: ProfileData[] = [{
os: OperatingSystem.Mac,
os: OperatingSystem.Macx86,
target: "x86_64-apple-darwin",
runTests: true,
}, {
os: OperatingSystem.Mac,
os: OperatingSystem.MacArm,
target: "aarch64-apple-darwin",
runTests: true,
}, {
os: OperatingSystem.Windows,
target: "x86_64-pc-windows-msvc",
Expand Down Expand Up @@ -83,7 +85,7 @@ const ci = {
RUST_BACKTRACE: "full",
},
steps: [
{ uses: "actions/checkout@v2" },
{ uses: "actions/checkout@v4" },
{ uses: "dsherret/rust-toolchain-file@v1" },
{
name: "Cache cargo",
Expand Down Expand Up @@ -119,11 +121,6 @@ const ci = {
"rustup target add aarch64-unknown-linux-musl",
].join("\n"),
},
{
name: "Setup (Mac aarch64)",
if: "matrix.config.target == 'aarch64-apple-darwin'",
run: "rustup target add aarch64-apple-darwin",
},
{
name: "Build (Debug)",
if: "!startsWith(github.ref, 'refs/tags/')",
Expand Down Expand Up @@ -160,7 +157,8 @@ const ci = {
...profiles.map((profile) => {
function getRunSteps() {
switch (profile.os) {
case OperatingSystem.Mac:
case OperatingSystem.MacArm:
case OperatingSystem.Macx86:
return [
`cd target/${profile.target}/release`,
`zip -r ${profile.zipFileName} dprint-plugin-exec`,
Expand Down
33 changes: 23 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
strategy:
matrix:
config:
- os: macOS-latest
- os: macos-12
run_tests: 'true'
target: x86_64-apple-darwin
- os: macOS-latest
run_tests: 'false'
- os: macos-latest
run_tests: 'true'
target: aarch64-apple-darwin
- os: windows-latest
run_tests: 'true'
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- name: Cache cargo
if: 'startsWith(github.ref, ''refs/tags/'') != true'
Expand All @@ -78,9 +78,6 @@ jobs:
sudo apt install gcc-aarch64-linux-gnu
sudo apt install musl musl-dev musl-tools
rustup target add aarch64-unknown-linux-musl
- name: Setup (Mac aarch64)
if: matrix.config.target == 'aarch64-apple-darwin'
run: rustup target add aarch64-apple-darwin
- name: Build (Debug)
if: '!startsWith(github.ref, ''refs/tags/'')'
env:
Expand Down Expand Up @@ -229,8 +226,6 @@ jobs:
run: 'echo "::set-output name=CHECKSUM::$(shasum -a 256 plugin.json | awk ''{print $1}'')"'
- name: Update Config Schema Version
run: 'sed -i ''s/exec\/0.0.0/exec\/${{ steps.get_tag_version.outputs.TAG_VERSION }}/'' deployment/schema.json'
- name: Create release notes
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
- name: Release
uses: softprops/action-gh-release@v1
env:
Expand All @@ -246,5 +241,23 @@ jobs:
dprint-plugin-exec-aarch64-unknown-linux-musl.zip
plugin.json
deployment/schema.json
body_path: ${{ github.workspace }}-CHANGELOG.txt
body: |-
## Install
Dependencies:
- Install dprint's CLI >= 0.40.0
In a dprint configuration file:
1. Specify the plugin url and checksum in the `"plugins"` array or run `dprint config add exec`:
```jsonc
{
// etc...
"plugins": [
"https://plugins.dprint.dev/exec-${{ steps.get_tag_version.outputs.TAG_VERSION }}.json@${{ steps.get_plugin_file_checksum.outputs.CHECKSUM }}"
]
}
```
2. Follow the configuration setup instructions found at https://github.com/dprint/dprint-plugin-exec#configuration
draft: false
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_DPRINTBOT_PAT }}

Expand Down
Loading

0 comments on commit dbeab08

Please sign in to comment.