From 62c8174e9677da5f768d507c60ee9b88c701c37e Mon Sep 17 00:00:00 2001 From: Henrik Gerdes Date: Fri, 16 Jun 2023 18:31:32 +0200 Subject: [PATCH] ci: fix release name --- .github/workflows/publish.yml | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..20a5559 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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/zip-release@0.7.1 + 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 }}