Skip to content

Commit

Permalink
ci: test publish-dry-run for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
felipebergamin committed Nov 24, 2022
1 parent bf8407f commit e0bcf63
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 22 deletions.
43 changes: 22 additions & 21 deletions .github/workflows/node.yaml → .github/workflows/code-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Checking code
name: Code check

on:
push:
Expand All @@ -8,7 +8,7 @@ on:

jobs:
setup:
if: github.event.pull_request.draft != true
# if: github.event.pull_request.draft != true
runs-on: ubuntu-latest

steps:
Expand All @@ -30,12 +30,13 @@ jobs:
if: steps.node_modules_cache.outputs.cache-hit != 'true'
- run: yarn install-peers
if: steps.node_modules_cache.outputs.cache-hit != 'true'
- run: git diff
- name: Ensure project is clean
uses: numtide/clean-git-action@v1
if: steps.cache-node_modules.outputs.cache-hit != 'true'

build:
if: github.event.pull_request.draft != true
# if: github.event.pull_request.draft != true
needs: setup
runs-on: ubuntu-latest

Expand All @@ -56,24 +57,24 @@ jobs:
- name: Ensure project is clean
uses: numtide/clean-git-action@v1

publish-dry-run:
if: github.event.pull_request.draft != true
needs: build
runs-on: ubuntu-latest
# publish-dry-run:
# if: github.event.pull_request.draft != true
# needs: build
# runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Cache node_modules
uses: actions/cache@v3
id: use_node_modules
with:
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: node_modules
# steps:
# - uses: actions/checkout@v3
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version-file: .nvmrc
# - name: Cache node_modules
# uses: actions/cache@v3
# id: use_node_modules
# with:
# key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
# path: node_modules

- name: publish --dry-run
run: npm publish --dry-run
# - name: publish --dry-run
# run: npm publish --dry-run

30 changes: 30 additions & 0 deletions .github/workflows/dry-run-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: dry-run publish

on:
workflow_run:
workflows: ["Code check"]
tags: ["*"]
types:
- completed
jobs:
dry-run-deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Cache node_modules
uses: actions/cache@v3
id: node_modules_cache
with:
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: node_modules

- name: publish --dry-run
run: npm publish --dry-run
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"types": "./dist/esm/index.d.ts",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"files": ["dist"],
"files": [
"dist"
],
"type": "module",
"repository": "https://github.com/profusion/use-location-query-state",
"exports": {
Expand Down

0 comments on commit e0bcf63

Please sign in to comment.