This repository has been archived by the owner on Mar 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
166 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: CI | ||
# taken from main dprint plugins | ||
# without npm for now | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.config.kind }} ${{ matrix.config.os }} | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
matrix: | ||
config: | ||
- os: ubuntu-latest | ||
kind: test_release | ||
- os: ubuntu-latest | ||
kind: test_debug | ||
|
||
env: | ||
CARGO_INCREMENTAL: 0 | ||
RUST_BACKTRACE: full | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: 1.57.0 | ||
override: true | ||
- name: Install wasm32 target | ||
if: matrix.config.kind == 'test_release' | ||
run: rustup target add wasm32-unknown-unknown | ||
|
||
- name: Cache cargo | ||
if: startsWith(github.ref, 'refs/tags/') != true | ||
uses: Swatinem/rust-cache@v1 | ||
|
||
- name: Build debug | ||
if: matrix.config.kind == 'test_debug' | ||
run: cargo build --verbose | ||
- name: Build release | ||
if: matrix.config.kind == 'test_release' | ||
run: cargo build --target wasm32-unknown-unknown --features wasm --release --verbose | ||
|
||
- name: Test debug | ||
if: matrix.config.kind == 'test_debug' | ||
run: cargo test --verbose | ||
- name: Test release | ||
if: matrix.config.kind == 'test_release' | ||
run: cargo test --release --verbose | ||
|
||
- name: Get tag version | ||
if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') | ||
id: get_tag_version | ||
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//} | ||
|
||
# CARGO PUBLISH | ||
- name: Cargo login | ||
if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') | ||
run: cargo login ${{ secrets.CRATES_TOKEN }} | ||
|
||
- name: Cargo publish | ||
if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') | ||
run: cargo publish | ||
|
||
# GITHUB RELEASE | ||
- name: Pre-release | ||
if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
# update config schema to have version | ||
sed -i 's/0.0.0/${{ steps.get_tag_version.outputs.TAG_VERSION }}/' deployment/schema.json | ||
# rename the wasm file | ||
(cd target/wasm32-unknown-unknown/release/ && mv dprint_plugin_css.wasm plugin.wasm) | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: | | ||
target/wasm32-unknown-unknown/release/plugin.wasm | ||
deployment/schema.json | ||
body: "" | ||
draft: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2021-2022 Salomon Popp | ||
|
||
Copyright (c) 2021-2022 David Sherret | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://plugins.dprint.dev/disrupted/dprint-plugin-css/0.0.0/schema.json", | ||
"type": "object", | ||
"definitions": { | ||
"useTabs": { | ||
"description": "Whether to use tabs (true) or spaces (false).", | ||
"type": "boolean", | ||
"default": false, | ||
"oneOf": [{ | ||
"const": true, | ||
"description": "" | ||
}, { | ||
"const": false, | ||
"description": "" | ||
}] | ||
}, | ||
"newLineKind": { | ||
"description": "The kind of newline to use.", | ||
"type": "string", | ||
"default": "lf", | ||
"oneOf": [{ | ||
"const": "auto", | ||
"description": "For each file, uses the newline kind found at the end of the last line." | ||
}, { | ||
"const": "crlf", | ||
"description": "Uses carriage return, line feed." | ||
}, { | ||
"const": "lf", | ||
"description": "Uses line feed." | ||
}, { | ||
"const": "system", | ||
"description": "Uses the system standard (ex. crlf on Windows)." | ||
}] | ||
} | ||
}, | ||
"properties": { | ||
"indentWidth": { | ||
"description": "The number of characters for an indent.", | ||
"default": 2, | ||
"type": "number" | ||
}, | ||
"useTabs": { | ||
"$ref": "#/definitions/useTabs" | ||
}, | ||
"newLineKind": { | ||
"$ref": "#/definitions/newLineKind" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters