Skip to content

Commit

Permalink
Alternative release testing
Browse files Browse the repository at this point in the history
  • Loading branch information
vkruglikov committed Jan 6, 2025
1 parent d759c69 commit c66911c
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 76 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/build-check.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/compare-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Compare Version

on:
workflow_call:
inputs:
package_path:
required: true
type: string
outputs:
has_changed:
description: Indicates whether the version has changed
value: ${{ jobs.compare-version.outputs.has_changed }}

jobs:
compare-version:
name: Check Version
runs-on: ubuntu-latest
outputs:
has_changed: ${{ steps.version_check.outputs.has_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Check package.json version
uses: hugorcd/[email protected]
id: version_check
with:
path: ${{ inputs.package_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 14 additions & 12 deletions .github/workflows/demo.yml → .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
name: Deploy @msw-devtools/demo

on:
# push:
# branches: ['master']
# paths:
# - 'packages/demo/**'
# - '.github/workflows/demo.yml'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write
workflow_call:

jobs:
deploy-demo:
compare-version:
name: Guard
uses: ./.github/workflows/compare-version.yml
with:
package_path: './packages/demo/package.json'

deploy:
name: Deploy @msw-devtools/demo
needs: compare-version
if: needs.compare-version.outputs.has_changed == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
name: Deploy @msw-devtools/extension

on:
workflow_dispatch:
workflow_call:

jobs:
deploy-extension:
compare-version:
name: Guard
uses: ./.github/workflows/compare-version.yml
with:
package_path: './packages/extension/package.json'

deploy:
name: Deploy @msw-devtools/extension
needs: compare-version
if: needs.compare-version.outputs.has_changed == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -18,11 +26,9 @@ jobs:
- name: Build @msw-devtools/extension
run: npm run build -- --filter=@msw-devtools/extension

- name: Archive @msw-devtools/extension
run: zip -r dist.zip ./packages/extension/dist

- name: Archive @msw-devtools/extension
run: |
zip -r dist.zip ./packages/extension/dist
tar -czf dist.tar.gz ./packages/extension/dist
- name: Release
Expand All @@ -31,5 +37,6 @@ jobs:
files: |
dist.zip
dist.tar.gz
make_latest: "true"
name: "@msw-devtools/extension"
tag_name: "@msw-devtools/extension@latest"
55 changes: 55 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy packages

on:
push:
branches: ['master']

jobs:
validation:
name: Validation and Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/install-npm-deps

- name: Build package
run: npm run build


deploy-extension:
needs: validation
name: Deploy @msw-devtools/extension
uses: ./.github/workflows/deploy-extension.yml

deploy-demo:
needs: validation
name: Deploy @msw-devtools/demo
uses: ./.github/workflows/deploy-demo.yml

changesets:
name: Deploy @msw-devtools/connect
needs: validation
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commit
fetch-depth: 0

- uses: ./.github/actions/setup-node
- uses: ./.github/actions/install-npm-deps

- name: Build package
env:
PUBLIC_PATH: /msw-devtools-extension/
run: npm run build -- --filter=@msw-devtools/connect

- name: Publish
uses: changesets/action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
38 changes: 0 additions & 38 deletions .github/workflows/release.yml

This file was deleted.

5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@

<h1 align="center">Mock Service Worker DevTools Extension</h1>

![Build Check](https://github.com/vkruglikov/msw-devtools-extension/actions/workflows/build-check.yml/badge.svg)
![Build Check](https://github.com/vkruglikov/msw-devtools-extension/actions/workflows/connect.yml/badge.svg)
![Build Check](https://github.com/vkruglikov/msw-devtools-extension/actions/workflows/demo.yml/badge.svg)
![Build Check](https://github.com/vkruglikov/msw-devtools-extension/actions/workflows/extension.yml/badge.svg)
![Build Check](https://github.com/vkruglikov/msw-devtools-extension/actions/workflows/deploy.yml/badge.svg)
[![npm version](https://img.shields.io/npm/v/@msw-devtools/connect.svg)](https://www.npmjs.com/package/@msw-devtools/connect)
[![Chrome Web Store](https://img.shields.io/chrome-web-store/v/jkclaelcdjjledfendcippjbhngkhkpm.svg)](https://chrome.google.com/webstore/detail/jkclaelcdjjledfendcippjbhngkhkpm)

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"check-types": "tsc --noEmit",
"build": "turbo check-types build",
"changeset": "changeset",
"release": "npm run build -- --filter=@msw-devtools/connect && changeset publish",
"dev": "turbo dev",
"clean": "rimraf packages/*/{node_modules,dist,.turbo} node_modules .turbo"
},
Expand Down

0 comments on commit c66911c

Please sign in to comment.