Skip to content

Commit

Permalink
Publish to GitHub Packages (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasuillard authored Nov 24, 2023
1 parent 30f69f6 commit 4b55dcc
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 23 deletions.
28 changes: 5 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
40 changes: 40 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4b55dcc

Please sign in to comment.