From c9962da763ff5b82e5ab57f8271224ff894f7dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:04:38 +0900 Subject: [PATCH 1/4] Update and rename on-release-created.yml to on-release-published.yml --- .github/workflows/on-release-created.yml | 42 ------------- .github/workflows/on-release-published.yml | 68 ++++++++++++++++++++++ 2 files changed, 68 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/on-release-created.yml create mode 100644 .github/workflows/on-release-published.yml diff --git a/.github/workflows/on-release-created.yml b/.github/workflows/on-release-created.yml deleted file mode 100644 index 6258fa693a..0000000000 --- a/.github/workflows/on-release-created.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: On Release Created (Publish misskey-js) - -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: [22.11.0] - - steps: - - uses: actions/checkout@v4.1.1 - with: - submodules: true - - name: Install pnpm - uses: pnpm/action-setup@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.4 - 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/on-release-published.yml b/.github/workflows/on-release-published.yml new file mode 100644 index 0000000000..a8172d5871 --- /dev/null +++ b/.github/workflows/on-release-published.yml @@ -0,0 +1,68 @@ +name: On Release Published (Publish misskey-js) + +on: + release: + types: + - published + + workflow_dispatch: + +jobs: + update-misskey-hub: + name: Update Misskey Hub + runs-on: ubuntu-latest + if: github.release.prerelease == false + + steps: + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + - name: Generate token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.RELEASE_APP_ID }} + private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: misskey-dev/misskey-hub-next + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ steps.generate-token.outputs.token }} + repository: misskey-dev/misskey-hub-next + event-type: misskey_release + client-payload: '{"version": "${{ github.release.name }}", "date": "${{ steps.date.outputs.date }}"}' + + publish-misskey-js: + name: Publish misskey-js + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + strategy: + matrix: + node-version: [22.11.0] + + steps: + - uses: actions/checkout@v4.1.1 + with: + submodules: true + - name: Install pnpm + uses: pnpm/action-setup@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4.0.4 + 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 }} From a62e7bba7da9c63cd99f7343312be310510c1276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:08:19 +0900 Subject: [PATCH 2/4] Update on-release-published.yml --- .github/workflows/on-release-published.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/on-release-published.yml b/.github/workflows/on-release-published.yml index a8172d5871..b137668cdf 100644 --- a/.github/workflows/on-release-published.yml +++ b/.github/workflows/on-release-published.yml @@ -1,4 +1,4 @@ -name: On Release Published (Publish misskey-js) +name: On Release Published on: release: @@ -9,9 +9,9 @@ on: jobs: update-misskey-hub: - name: Update Misskey Hub + name: Update Misskey Hub (Repository Dispatch) runs-on: ubuntu-latest - if: github.release.prerelease == false + if: github.event.name == 'release' && github.release.prerelease == false steps: - name: Get current date From f8fde7e59068da781181b08ec328a3ff2d7652ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:10:11 +0900 Subject: [PATCH 3/4] =?UTF-8?q?workflow=5Fdispatch=E3=81=AE=E3=81=A8?= =?UTF-8?q?=E3=81=8D=E3=81=AF=E3=81=84=E3=81=A4=E3=81=A7=E3=82=82=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=82=92=E3=81=8B=E3=81=91=E3=82=89=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/on-release-published.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-release-published.yml b/.github/workflows/on-release-published.yml index b137668cdf..8b5debab8b 100644 --- a/.github/workflows/on-release-published.yml +++ b/.github/workflows/on-release-published.yml @@ -11,7 +11,7 @@ jobs: update-misskey-hub: name: Update Misskey Hub (Repository Dispatch) runs-on: ubuntu-latest - if: github.event.name == 'release' && github.release.prerelease == false + if: github.event.name == 'workflow_dispatch' || github.release.prerelease == false steps: - name: Get current date From e1a76d37b60193cb28474089704c1374860aad98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:18:08 +0900 Subject: [PATCH 4/4] Update on-release-published.yml --- .github/workflows/on-release-published.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on-release-published.yml b/.github/workflows/on-release-published.yml index 8b5debab8b..b966c2fe70 100644 --- a/.github/workflows/on-release-published.yml +++ b/.github/workflows/on-release-published.yml @@ -6,12 +6,21 @@ on: - published workflow_dispatch: + inputs: + misskey-hub: + type: boolean + description: 'Update Misskey Hub' + default: false + misskey-js: + type: boolean + description: 'Start Release Candidate' + default: false jobs: update-misskey-hub: name: Update Misskey Hub (Repository Dispatch) runs-on: ubuntu-latest - if: github.event.name == 'workflow_dispatch' || github.release.prerelease == false + if: ${{ (github.event.name == 'workflow_dispatch' && inputs.misskey-hub == true) || github.release.prerelease == false }} steps: - name: Get current date @@ -36,6 +45,7 @@ jobs: publish-misskey-js: name: Publish misskey-js runs-on: ubuntu-latest + if: ${{ (github.event.name == 'workflow_dispatch' && inputs.misskey-js == true) || github.event.name == 'release' }} permissions: contents: read