From 4b55dccef0f01e8f33c83ff72a176a8e6e05c888 Mon Sep 17 00:00:00 2001 From: Yuchan Lee Date: Fri, 24 Nov 2023 12:44:56 +0900 Subject: [PATCH] Publish to GitHub Packages (#2) --- .github/workflows/ci.yml | 28 +++++------------------- .github/workflows/publish.yaml | 40 ++++++++++++++++++++++++++++++++++ package.json | 4 ++++ 3 files changed, 49 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fa8f41..a52043f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,33 +72,15 @@ jobs: files: coverage/e2e/clover.xml flags: e2e - build-and-release: - name: Build and Release + release: + name: Release needs: lint-and-test runs-on: ubuntu-latest if: startswith(github.ref, 'refs/tags/v') # For v* tags permissions: contents: write steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up PNPM - uses: pnpm/action-setup@v2 + - name: Create release + uses: softprops/action-gh-release@v1 with: - version: latest - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install PNPM deps - run: pnpm install - - - name: Build app - run: pnpm run build - - - name: Publish to NPM - run: pnpm publish --dry-run # TODO: Not ready to publish, yet + generate_release_notes: true diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..91e5f7b --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,40 @@ +name: Publish Package to GitHub Packages +on: + release: + types: [published] + +permissions: read-all + +jobs: + build-and-publish: + name: Build and Publish + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up PNPM + uses: pnpm/action-setup@v2 + with: + version: latest + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: pnpm + registry-url: https://npm.pkg.github.com + + - name: Install PNPM deps + run: pnpm install + + - name: Build app + run: pnpm run build + + - name: Publish to NPM + env: + NODE_AUTH_TOKEN: ${{ github.token }} + run: pnpm publish diff --git a/package.json b/package.json index d3c6cc9..7771a8f 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,10 @@ "openapi" ], "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/lasuillard/raindrop-client.git" + }, "author": { "name": "Yuchan Lee", "url": "https://github.com/lasuillard",