Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

chore: add deprecation notice (#18) #143

chore: add deprecation notice (#18)

chore: add deprecation notice (#18) #143

Workflow file for this run

name: CI
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: dtolnay/rust-toolchain@stable
- 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@v2
- 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\//}"
# NPM
- uses: actions/setup-node@v2
if: matrix.config.kind == 'test_release'
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: Setup and test npm deployment
if: matrix.config.kind == 'test_release'
run: |
npm install
node setup.js ${{ steps.get_tag_version.outputs.TAG_VERSION }}
npm run test
working-directory: ./deployment/npm
- name: npm publish
if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm publish --access public
git reset --hard
working-directory: ./deployment/npm
# 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/css\/0.0.0/css\/${{ 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: |
## Install
[Install](https://dprint.dev/install/) and [setup](https://dprint.dev/setup/) dprint.
Then in your project's dprint configuration file:
1. Specify the plugin url in the `"plugins"` array.
2. Ensure `.css` file extensions are matched in an `"includes"` pattern.
3. Add a `"css"` configuration property if desired.
```jsonc
{
// ...etc...
"css": {
// css config goes here
},
"includes": [
"**/*.{css}"
],
"plugins": [
"https://github.com/disrupted/dprint-plugin-css/raw/${{ steps.get_tag_version.outputs.TAG_VERSION }}/deployment/npm/plugin.wasm"
]
}
```
## JS Formatting API
* [JS Formatter](https://github.com/dprint/js-formatter) - Browser/Deno and Node
* [npm package](https://www.npmjs.com/package/dprint-plugin-css)
draft: false