Skip to content

Commit

Permalink
ci: update release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
jpntex committed Oct 31, 2023
1 parent 836f406 commit 3db4c18
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 84 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/gh_release.yml

This file was deleted.

58 changes: 12 additions & 46 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@ name: Release production
run-name: Release production - ${{ github.ref_name }}

on:
workflow_dispatch:
push:
branches:
- main

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

jobs:
check:
runs-on: ubuntu-20.04
steps:
- name: Validate release target
if: ${{ github.ref_name != github.event.repository.default_branch }}
run: exit 1

build:
needs:
- check
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -41,40 +34,13 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Check if we have anything to release
run: pnpm run changeset:status

- name: Linting
run: pnpm run lint:ui

- name: Unit tests
run: pnpm run test

- name: Changeset Version
run: pnpm run version:prod
- name: Create Release Pull Request & Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
commit: "chore: release packages"
title: "chore: release packages production"
env:
GITHUB_TOKEN: ${{ secrets.P_GITHUB_TOKEN }}

- name: Set git user
run: |
git config user.name 'indielayer-ci'
git config user.email 'bot+ci@indielayer.com'
- name: Build
run: |
pnpm install --frozen-lockfile=false
pnpm run build:ui
- name: Publish packages
run: pnpm run publish:prod
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Commit changes
run: |
git add .
git restore --staged .npmrc
git commit -m "chore: release packages"
git tag -l
git push
git push --tags
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"publish:prod": "changeset publish",
"version:snapshot": "changeset version --snapshot dev",
"publish:snapshot": "changeset publish --no-git-tag --snapshot --tag dev",
"changeset:status": "node .scripts/changesetStatus.js"
"changeset:status": "node .scripts/changesetStatus.js",
"release": "pnpm build && pnpm publish:prod"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 3db4c18

Please sign in to comment.