From 9d0b7fbca7a6c54096f4142cb823ce59be10e976 Mon Sep 17 00:00:00 2001 From: Vinicius Reis Date: Thu, 11 Aug 2022 15:01:44 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20adjust=20release=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vinicius Reis --- .github/dependabot.yml | 1 + .../{npm-publish.yml => doc-publish.yml} | 31 +++++------ .github/workflows/publish.yml | 51 +++++++++++++++++++ 3 files changed, 65 insertions(+), 18 deletions(-) rename .github/workflows/{npm-publish.yml => doc-publish.yml} (53%) create mode 100644 .github/workflows/publish.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1b86cc8..2ab2d39 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,3 +8,4 @@ updates: time: "03:00" timezone: Europe/Paris open-pull-requests-limit: 10 + versioning-strategy: increase diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/doc-publish.yml similarity index 53% rename from .github/workflows/npm-publish.yml rename to .github/workflows/doc-publish.yml index 632919c..b733089 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/doc-publish.yml @@ -1,9 +1,4 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Publish +name: Doc Publish on: release: @@ -13,7 +8,7 @@ jobs: publish: runs-on: ubuntu-latest - name: Build and publish to npm + name: Publish doc steps: - name: Check actor permission level uses: skjnldsv/check-actor-permission@v2 @@ -21,14 +16,14 @@ jobs: require: admin - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@v1.1 + uses: skjnldsv/read-package-engines-version-actions@v1.2 id: versions with: - fallbackNode: '^12' - fallbackNpm: '^6' + fallbackNode: '^16' + fallbackNpm: '^8' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} uses: actions/setup-node@v2 @@ -41,11 +36,11 @@ jobs: - name: Install dependencies & build run: | npm ci - npm run build --if-present + npm run build + npm run build:doc - - name: Publish - run: | - npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN - npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist/doc diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..2e0d20d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,51 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ”’โ€‹ Check actor permission level + uses: skjnldsv/check-actor-permission@v2 + with: + require: admin + + - name: ๐Ÿ“ฅโ€‹ Checkout + uses: actions/checkout@v3 + + - name: ๐Ÿช„ Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@v1.2 + id: versions + with: + fallbackNode: '^16' + fallbackNpm: '^8' + + - name: ๐Ÿ”งโ€‹ Setup Node (NPM Registry) + uses: actions/setup-node@v3 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + + - name: ๐Ÿ“ฆ Install dependencies & build + run: | + npm ci + npm run build + + - name: ๐Ÿ“ฃ Publish package on NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: ๐Ÿ”งโ€‹ Setup Github Registry + uses: actions/setup-node@v3 + with: + registry-url: 'https://npm.pkg.github.com' + + - name: ๐Ÿ“ฃ Publish package on GPR + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}