From d1931f0454c8db53d40607f88d71efa8b54e4544 Mon Sep 17 00:00:00 2001 From: Oscar Otero Date: Wed, 21 Oct 2020 03:43:37 +0200 Subject: [PATCH] Add support for Deno (#1446) * testing gh-action * commit deno code * bug * configured name/email of the commit * deno tag * gh-action event * updated readme * force new release * force a new commit * use external repo for deno version * checkout using a PAT * try PAT --- .github/workflows/deno.yml | 53 ++++++++++++++++++++++++++++++++++++++ README.md | 13 ++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/deno.yml 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)