Skip to content

Commit

Permalink
Merge pull request #31 from pho3nixf1re/changeset-action-update
Browse files Browse the repository at this point in the history
Update to use the asdf and changeset action
  • Loading branch information
pho3nixf1re authored Jan 18, 2025
2 parents 1ba8bb1 + ff1b4fe commit 6226f03
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 48 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-papayas-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'pho3nixf1re.net': minor
---

Update to use the asdf and changeset action
7 changes: 2 additions & 5 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
- name: Install asdf & tools
uses: asdf-vm/actions/install@v3
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Restore cache
Expand Down
56 changes: 15 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,27 @@
name: Tag release changeset
name: Release

on:
push:
branches:
- main
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
prepare:
name: Setup dependencies
release:
name: Release
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
token: ${{ env.GITHUB_TOKEN }}
- name: Configure git author
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Check for changeset
run: npx changeset status --output changesets.json
- name: Set release output
id: set_release
run:
echo "hasRelease=$(jq -r '.releases | length > 0' changesets.json)" >>
"$GITHUB_OUTPUT"
- name: Rotate logs and release
if: ${{ steps.set_release.outputs.hasRelease == 'true' }}
id: release
run: |
npx changeset version
npx changeset tag
git push --follow-tags
echo "release=$(jq -r '.releases[0].newVersion' changesets.json)" >> $GITHUB_OUTPUT
- name: Create github release notes
if: ${{ steps.release.outputs.release != '' }}
run: |
gh release create "v${{ steps.release.outputs.release }}" --generate-notes
gh workflow run build-and-deploy.yml --ref "v${{ steps.release.outputs.release }}"
uses: actions/checkout@v3

- name: Install asdf & tools
uses: asdf-vm/actions/install@v3

- name: Install Dependencies
run: npm install

- name: Create Release Pull Request
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6226f03

Please sign in to comment.