-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from nextcloud-libraries/fix/update-workflows
chore: Update workflows from organization
- Loading branch information
Showing
5 changed files
with
88 additions
and
14 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
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
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
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
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,60 @@ | ||
# 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 | ||
# | ||
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors | ||
# SPDX-License-Identifier: MIT | ||
|
||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
name: Build and publish to npm | ||
steps: | ||
- name: Check actor permission level | ||
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0 | ||
with: | ||
require: write | ||
|
||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Read package.json node and npm engines version | ||
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 | ||
id: versions | ||
with: | ||
fallbackNode: '^20' | ||
fallbackNpm: '^10' | ||
|
||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }} | ||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3 | ||
with: | ||
node-version: ${{ steps.versions.outputs.nodeVersion }} | ||
|
||
- name: Set up npm ${{ steps.versions.outputs.npmVersion }} | ||
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' | ||
|
||
- name: Install dependencies & build | ||
env: | ||
CYPRESS_INSTALL_BINARY: 0 | ||
run: | | ||
npm ci | ||
npm run build --if-present | ||
- name: Publish | ||
run: | | ||
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN | ||
npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |