Skip to content

Commit

Permalink
ci: add next tag (#61)
Browse files Browse the repository at this point in the history
- Publish `next` tag
- Add `unpublish` script
  • Loading branch information
helciofranco authored Apr 3, 2024
1 parent 45dbddd commit fc0fe27
Show file tree
Hide file tree
Showing 5 changed files with 202 additions and 60 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Release to @dev tag
- name: Release to @next tag
if: steps.changesets.outputs.published != 'true'
run: |
git checkout main
pnpm changeset version --snapshot dev
pnpm changeset publish --tag dev
pnpm changeset version --snapshot next
pnpm changeset publish --tag next
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/unpublish-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Unpublish old versions"

on:
workflow_dispatch:
inputs:
delete_packages:
type: boolean
description: Delete packages? otherwise dry-run mode will be used
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
clean-npm-versions:
name: Unpublish versions next, preview, main...
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v3
- uses: FuelLabs/github-actions/setups/node@master
- uses: FuelLabs/github-actions/setups/npm@master
with:
npm-token: ${{ secrets.NPM_TOKEN }}
- run: |
node ./scripts/unpublish.js
env:
DELETE_PACKAGES: ${{ github.event.inputs.delete_packages }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@xstate/cli": "^0.5.2",
"compare-versions": "6.1.0",
"dotenv": "^16.3.1",
"eslint": "^8.48.0",
"husky": "^8.0.3",
Expand Down
Loading

0 comments on commit fc0fe27

Please sign in to comment.