diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 632b488..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow will install Deno then run `deno lint` and `deno test`. -# For more information see: https://github.com/denoland/setup-deno - -name: Deploy - -on: - push: - tags: - - '*' - -permissions: - contents: write - -jobs: - Deploy: - runs-on: ubuntu-latest - - steps: - - name: Setup repo - uses: actions/checkout@v3 - - - name: Setup Deno - uses: denoland/setup-deno@61fe2df320078202e33d7d5ad347e7dcfa0e8f31 - with: - deno-version: v2.x - - - name: Run build - run: deno task build - - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: yaksok.js diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3534752 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,44 @@ +name: Publish +on: + push: + branches: + - main + paths: + - 'deno.json' + +jobs: + Publish: + runs-on: ubuntu-latest + + permissions: + contents: write + id-token: write + + steps: + - name: Setup repo + uses: actions/checkout@v4 + + - name: Setup Deno + uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + + - name: Run linter + run: deno lint + + - name: Run tests + run: deno test --allow-read + + - name: Get version from deno.json + id: get_version + run: echo "::set-output name=version::$(jq -r .version deno.json)" + + - name: Create GitHub tag + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git tag -a v${{ steps.get_version.outputs.version }} -m "Release version ${{ steps.get_version.outputs.version }}" + git push origin v${{ steps.get_version.outputs.version }} + + - name: Publish to JSR + run: deno publish diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1013c44..babedd5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ permissions: contents: read jobs: - test: + Test: runs-on: ubuntu-latest steps: diff --git a/deno.json b/deno.json index fe38273..1ebf455 100644 --- a/deno.json +++ b/deno.json @@ -16,6 +16,6 @@ } }, "name": "@yaksok-ts/core", - "version": "0.1.9", + "version": "0.1.10", "exports": "./index.ts" } \ No newline at end of file