Skip to content

Bump to 0.2.5

Bump to 0.2.5 #230

Workflow file for this run

# https://github.com/NixOS/nixos-artwork/blob/35ebbbf01c3119005ed180726c388a01d4d1100c/logo/README.md#L5
name: ❄️
on:
push:
tags:
# Do not add v prefix: https://github.com/dprint/plugins/blob/75a3755b8734eee294214a7d7efc18145668a99f/README.md?plain=1#L27
# https://github.com/actions/runner/issues/1699#issuecomment-1046796067
- '[0-9]+.[0-9]+.[0-9]+'
branches: [main]
paths:
- '.github/workflows/nix.yml'
- '**.nix'
- 'flake.*'
- '**.rs'
- 'Cargo.*'
- 'example'
- 'Taskfile.yml'
pull_request:
paths:
- '.github/workflows/nix.yml'
- '**.nix'
- 'flake.*'
- '**.rs'
- 'Cargo.*'
- 'example'
- 'Taskfile.yml'
schedule:
# Every 10:42 JST
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '42 1 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 30
# outputs:
# wasm-zip-url: ${{ steps.upload.outputs.artifact-url }}
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # v16
- run: nix develop --command echo 'This step should be done before any other "nix develop" steps because of measuring Nix build time'
- run: nix flake check
- run: nix flake show
- run: nix develop --command task deps
- uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2
- run: nix develop --command task
- name: Upload WASM file as an artifact
# id: upload
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: 'plugins'
path: 'target/wasm32-unknown-unknown/release/dprint_plugin_typstyle.wasm'
check:
strategy:
fail-fast: false
# Syntax https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
matrix:
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for 'n.0'
dprint-version: [
'', # empty means to latest: https://github.com/dprint/check/blob/2f1cf31537886c3bfb05591c031f7744e48ba8a1/action.yml#L8
'0.48.0', # selfup {"extract":"\\d[^']+","replacer":["dprint", "--version"], "nth": 2}
]
runs-on: ubuntu-24.04
timeout-minutes: 15
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: dprint/check@2f1cf31537886c3bfb05591c031f7744e48ba8a1 # v2.2
with:
dprint-version: '${{ matrix.dprint-version }}'
- name: Run with WASM plugin
env:
GH_TOKEN: ${{ github.token }}
run: |
gh run download
tree
dprint --version
dprint output-file-paths --config=dprint-dogfooding.json "--plugins=${PWD}/plugins/dprint_plugin_typstyle.wasm"
- run: dprint check --config=dprint-dogfooding.json "--plugins=${PWD}/plugins/dprint_plugin_typstyle.wasm"
id: dprint-check
continue-on-error: true
- run: false
if: steps.dprint-check.outcome == 'success'
- run: |
dprint fmt --config=dprint-dogfooding.json "--plugins=${PWD}/plugins/dprint_plugin_typstyle.wasm"
diff ./examples/raw.typ ./examples/expected.typ
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-24.04
timeout-minutes: 15
needs: [build, check]
env:
GH_TOKEN: ${{ github.token }}
steps:
# Required to checkout for gh command
- uses: actions/checkout@v4
- run: |
gh run download
tree
mv plugins/dprint_plugin_typstyle.wasm plugins/plugin.wasm
- run: |
gh release create --verify-tag "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" plugins/plugin.wasm