diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml new file mode 100644 index 000000000..5cd2e8dbe --- /dev/null +++ b/.github/workflows/deno.yml @@ -0,0 +1,53 @@ +name: Deno + +on: + push: + tags: + - "8.*" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Setup Deno environment + uses: denolib/setup-deno@v2.2.0 + with: + deno-version: v1.x + + - name: Checkout postcss-deno + uses: actions/checkout@v2 + with: + repository: postcss/postcss-deno + token: ${{ secrets.PAT }} + + - name: Checkout postcss + uses: actions/checkout@v2 + with: + ref: master + path: postcss + + - name: Convert the code + run: | + rm -rf deno + deno run --unstable --allow-write --allow-read to_deno.js + deno fmt deno + cp postcss/README.md deno/ + cp postcss/CHANGELOG.md deno/ + cp postcss/LICENSE deno/ + + deno test --unstable --allow-read deno/test/* + + - name: Get the tag name + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - name: Commit the changes and create the tag + run: | + git config user.name deno-conversion + git config user.email github-actions@github.com + git add deno + git commit -m "update code" + git push + git tag ${{ steps.get_version.outputs.VERSION }} + git push --tags diff --git a/README.md b/README.md index a78a978b0..57660840b 100644 --- a/README.md +++ b/README.md @@ -369,6 +369,19 @@ prefixer({ display: 'flex' }) //=> { display: ['-webkit-box', '-webkit-flex', '- [webpack]: https://webpack.github.io/ +### Deno + +PostCSS also supports [Deno], the new JavaScript/TypeScript runtime. + +```js +import postcss from "https://deno.land/x/postcss/mod.js"; +import autoprefixer from "https://dev.jspm.io/autoprefixer"; + +const result = await postcss([autoprefixer]).process(css); +``` + +[Deno]: https://deno.land/ + ### Runners * **Grunt**: [`@lodder/grunt-postcss`](https://github.com/C-Lodder/grunt-postcss)