From a475ce91932be1baaf7b9fd8f28a098ed4962fd0 Mon Sep 17 00:00:00 2001 From: double beep <38133098+double-beep@users.noreply.github.com> Date: Sun, 22 Jan 2023 13:46:57 +0200 Subject: [PATCH] shared workflows --- .github/workflows/nodejs.yml | 21 +------- .github/workflows/npm-publish.yml | 59 +---------------------- .github/workflows/release.yml | 17 ------- .github/workflows/update_dependencies.yml | 29 +---------- 4 files changed, 3 insertions(+), 123 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index b800858..f5337cc 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -4,23 +4,4 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Using Node 14 - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: Update npm version to latest - run: npm install -g npm@latest # stop showing warnings about the lockfile - - name: Install dependencies - run: | - npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN - npm install - env: - NODE_AUTH_TOKEN: ${{github.token}} - - name: Compile - run: npm run build - - name: Run tests - run: npm run test + uses: userscripters/shared-actions/.github/workflows/workflow-nodejs.yml@master \ No newline at end of file diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 3868246..25b5823 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -6,61 +6,4 @@ on: jobs: build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Using Node 14 - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: Update npm version to latest - run: npm install -g npm@latest - - name: Install dependencies - run: | - npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN - npm install - env: - NODE_AUTH_TOKEN: ${{github.token}} - - name: Compile - run: npm run build - - name: Run tests - run: npm run test - - publish-gh: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 14 - registry-url: "https://registry.npmjs.org" - scope: "@${{github.repository_owner}}" - - run: npm install - - run: | - npm config set @${{github.repository_owner}}:registry https://npm.pkg.github.com - npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN - npm publish --access public - env: - NODE_AUTH_TOKEN: ${{secrets.PAT}} - - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 14 - registry-url: "https://registry.npmjs.org" - scope: "@${{github.repository_owner}}" - - run: npm install - env: - NODE_AUTH_TOKEN: ${{github.token}} - - run: | - npm config set @${{github.repository_owner}}:registry https://registry.npmjs.org - npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN - npm publish --access public - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} \ No newline at end of file + uses: userscripters/shared-actions/.github/workflows/workflow-npm_publish.yml@master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index feb1585..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "release" - -on: - push: - tags: - - "*" - -jobs: - release: - runs-on: "ubuntu-latest" - - steps: - - uses: actions/checkout@v2 - - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.PAT }}" - prerelease: false diff --git a/.github/workflows/update_dependencies.yml b/.github/workflows/update_dependencies.yml index a204526..ee8538f 100644 --- a/.github/workflows/update_dependencies.yml +++ b/.github/workflows/update_dependencies.yml @@ -7,31 +7,4 @@ on: jobs: build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Using Node 14 - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: Update npm version to latest - run: npm install -g npm@latest # stop showing warnings about the lockfile - - name: Install dependencies - run: | - npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN - npm install - env: - NODE_AUTH_TOKEN: ${{github.token}} - - name: Update to the latest minor/patch version - run: npx npm-check-updates -u --target minor - - name: Install updated dependencies & update lockfile - run: npm install && npm update - - name: Make sure everything's ok - run: npm test - - name: Push changes to GitHub - run: | - git config --global user.name "github-actions" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git diff --quiet && git diff --staged --quiet || git commit -am "$(date +%F) Automated dependencies update" - git push + uses: userscripters/shared-actions/.github/workflows/workflow-update_dependencies.yml@master