Skip to content

Commit

Permalink
changedir-in-publish-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajpatel committed May 1, 2022
1 parent 669978b commit 5d228c4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 35 deletions.
58 changes: 24 additions & 34 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,57 @@ on:
types: [created]

jobs:
build:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm i -g yarn
- run: yarn install
- run: yarn build
- uses: actions/upload-artifact@master
- name: node_modules cache
id: node-modules-cache
uses: actions/cache@v2
env:
cache-name: node-modules-yarn
cache-fingerprint: ${{ env.node-version }}-${{ hashFiles('yarn.lock') }}
with:
name: publish-artifact
path: |
.
!./node_modules
!./.git
!./.husky
!./.github
!./.vscode
!stat
if-no-files-found: error
path: node_modules
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.cache-fingerprint }}
restore-keys: ${{ runner.os }}-${{ env.cache-name }}

- name: Yarn install
# called at most once for the workflow by the "setup" job
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --prefer-offline --frozen-lockfile

publish-npm:
needs: [ build ]
needs: [ setup ]
runs-on: ubuntu-latest
steps:
- run: mkdir -p publish
- uses: actions/download-artifact@master
with:
name: publish-artifact
path: publish
- name: Display structure of downloaded files
run: ls -R
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: cd publish
- run: npm i -g yarn
- run: yarn install --prefer-offline --frozen-lockfile
- run: yarn build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-gpr:
needs: [ build ]
needs: [ setup ]
runs-on: ubuntu-latest
steps:
- run: mkdir -p publish
- uses: actions/download-artifact@master
with:
name: publish-artifact
path: publish
- name: Display structure of downloaded files
run: ls -R
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
registry-url: https://npm.pkg.github.com/
- run: cd publish
- run: npm i -g yarn
- run: yarn install --prefer-offline --frozen-lockfile
- run: yarn build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "list-repos",
"version": "1.0.0-beta.7",
"version": "1.0.0-beta.8",
"description": "List all the repos, their HEADs and clean status in the Current Directory or the Supplied Directory",
"main": "dist/index.cjs",
"type": "commonjs",
Expand Down

0 comments on commit 5d228c4

Please sign in to comment.