-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Create Release & Publish Package to npmjs | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
NODE_VERSION: 18.x | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "${{ env.NODE_VERSION }}" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Set Version | ||
run: | | ||
npm version --no-commit-hooks --allow-same-version --no-git-tag-version ${{ github.ref_name }} | ||
npm version | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build app | ||
run: | | ||
# Running test | ||
if [[ "$(node --version)" == "v18"* ]]; then | ||
export NODE_OPTIONS=--openssl-legacy-provider | ||
fi | ||
npm run dist | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build | ||
path: publish | ||
|
||
- name: Archive Release | ||
uses: thedoctor0/[email protected] | ||
with: | ||
type: zip | ||
filename: joplin-plugin-remote-note-pull.zip | ||
path: publish | ||
|
||
- name: Create GH release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: Release ${{ github.ref_name }} | ||
generate_release_notes: true | ||
prerelease: false | ||
files: joplin-plugin-remote-note-pull.zip | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push npm package | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |