From 31a39776f52783e6e7630604b86d2694cc9e9b94 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 23 Jan 2024 00:19:43 +0900 Subject: [PATCH] chore: publish misskey-js automatically (#13014) * chore: publish @misskey-dev/misskey-js * remove @misskey-dev/ * ?? * correct version * version --- .github/workflows/on-release-created.yml | 43 ++++++++++++++++++++++++ .github/workflows/test-misskey-js.yml | 14 ++++++++ packages/misskey-js/LICENSE | 2 +- packages/misskey-js/package.json | 2 +- 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/on-release-created.yml diff --git a/.github/workflows/on-release-created.yml b/.github/workflows/on-release-created.yml new file mode 100644 index 0000000000..b4c2d843f3 --- /dev/null +++ b/.github/workflows/on-release-created.yml @@ -0,0 +1,43 @@ +name: Publish Node.js Package + +on: + release: + types: [created] + + workflow_dispatch: + +jobs: + publish-misskey-js: + name: Publish misskey-js + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + strategy: + matrix: + node-version: [20.10.0] + + steps: + - uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + registry-url: 'https://registry.npmjs.org' + - name: Publish package + run: | + corepack enable + pnpm i --frozen-lockfile + pnpm build + pnpm --filter misskey-js publish --access public --no-git-checks --provenance + env: + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} diff --git a/.github/workflows/test-misskey-js.yml b/.github/workflows/test-misskey-js.yml index 10c7ccf4d3..5aed385df9 100644 --- a/.github/workflows/test-misskey-js.yml +++ b/.github/workflows/test-misskey-js.yml @@ -54,3 +54,17 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} files: ./packages/misskey-js/coverage/coverage-final.json + + check-version: + # ルートの package.json と packages/misskey-js/package.json のバージョンが一致しているかを確認する + name: Check version + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: Check version + run: | + if [ "$(jq -r '.version' package.json)" != "$(jq -r '.version' packages/misskey-js/package.json)" ]; then + echo "Version mismatch!" + exit 1 + fi diff --git a/packages/misskey-js/LICENSE b/packages/misskey-js/LICENSE index 11c1f9ce22..63762b85d8 100644 --- a/packages/misskey-js/LICENSE +++ b/packages/misskey-js/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021-2022 syuilo and other contributors +Copyright (c) 2021-2024 syuilo and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index 7132d0896a..06c3ce6b54 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "misskey-js", - "version": "0.0.16", + "version": "2024.2.0-beta.3", "description": "Misskey SDK for JavaScript", "types": "./built/dts/index.d.ts", "exports": {