Unverified Commit f6a20bfd authored by Hong Minhee's avatar Hong Minhee
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading

.github/FUNDING.yaml

0 → 100644
+1 −0
Original line number Diff line number Diff line
github: dahlia
+80 −0
Original line number Diff line number Diff line
name: main
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    permissions:
      checks: write
      pull-requests: write
    services:
      rabbitmq:
        image: rabbitmq
        env:
          RABBITMQ_DEFAULT_USER: guest
          RABBITMQ_DEFAULT_PASS: guest
        ports:
        - 5672:5672
    env:
      AMQP_URL: amqp://guest:guest@localhost:5672
    steps:
    - uses: actions/checkout@v4
    - uses: denoland/setup-deno@v1
      with:
        deno-version: v2.x
    - uses: actions/setup-node@v4
      with:
        node-version: lts/*
    - uses: oven-sh/setup-bun@v1
      with:
        bun-version: latest
    - run: deno task test --junit-path=.test-report.xml
    - uses: EnricoMi/publish-unit-test-result-action@v2
      if: always()
      with:
        files: .test-report.xml
    - run: deno task check
    - run: deno task dnt
    - run: bun run ./test_runner.js
      working-directory: ${{ github.workspace }}/npm/

  publish:
    if: github.event_name == 'push'
    needs: [test]
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
    - uses: actions/checkout@v4
    - uses: denoland/setup-deno@v1
      with:
        deno-version: v2.x
    - uses: actions/setup-node@v4
      with:
        node-version: lts/*
    - if: github.ref_type == 'branch'
      run: |
        jq \
          --arg build "$GITHUB_RUN_NUMBER" \
          --arg commit "${GITHUB_SHA::8}" \
          '.version = .version + "-dev." + $build + "+" + $commit' \
          deno.json > deno.json.tmp
        mv deno.json.tmp deno.json
    - if: github.ref_type == 'tag'
      run: '[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]'
    - run: 'deno task dnt "$(jq -r .version deno.json)"'
      env:
        DNT_TEST: false
    - run: |
        set -ex
        npm config set //registry.npmjs.org/:_authToken "$NPM_AUTH_TOKEN"
        if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then
          npm publish --provenance --access public
        else
          npm publish --provenance --access public --tag dev
        fi
      env:
        NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
      working-directory: ${{ github.workspace }}/npm/
    - run: deno publish --allow-dirty

.gitignore

0 → 100644
+2 −0
Original line number Diff line number Diff line
.dnt-import-map.json
npm/
+6 −0
Original line number Diff line number Diff line
{
  "recommendations": [
    "denoland.vscode-deno",
    "streetsidesoftware.code-spell-checker"
  ]
}

.vscode/settings.json

0 → 100644
+33 −0
Original line number Diff line number Diff line
{
  "cSpell.enabled": false,
  "deno.enable": true,
  "deno.unstable": [
    "temporal"
  ],
  "editor.detectIndentation": false,
  "editor.indentSize": 2,
  "editor.insertSpaces": true,
  "files.eol": "\n",
  "files.insertFinalNewline": true,
  "files.trimFinalNewlines": true,
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features",
    "editor.formatOnSave": true
  },
  "[jsonc]": {
    "editor.defaultFormatter": "vscode.json-language-features",
    "editor.formatOnSave": true
  },
  "[typescript]": {
    "editor.defaultFormatter": "denoland.vscode-deno",
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.sortImports": "always"
    }
  },
  "cSpell.words": [
    "fedify",
    "unlisten",
    "UNLOGGED"
  ]
}