Skip to content

Commit

Permalink
chore(ci): update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
PKief committed Jan 21, 2025
1 parent c6b66ac commit 00a6139
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release + Publish
name: πŸš€ Release + Publish

on:
workflow_dispatch:
Expand All @@ -24,29 +24,37 @@ jobs:
id-token: write

steps:
- name: Checkout πŸ›ŽοΈ
- name: βœ… Use App Token for the Bot which is allowed to create releases
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}

- name: πŸ›ŽοΈ Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0

- name: Setup Platform πŸ› 
- name: πŸ›  Setup Platform
uses: oven-sh/setup-bun@v2
with:
bun-version-file: .bun-version

- name: Install dependencies πŸ“¦
- name: πŸ“¦ Install dependencies
run: |
bun install --frozen-lockfile
bun add -g npm
- name: Update version β†—
- name: β†— Update version
run: |
git config --global user.name 'Philipp Kief'
git config --global user.email 'PKief@users.noreply.github.com'
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git config --global push.followTags true
npm version ${{ env.VERSION_CHANGE }} -m "Release %s"
- name: Get meta data πŸ”
- name: πŸ” Get meta data
run: |
VERSION=$(bun --print "(await import('./package.json')).version")
NAME=$(bun --print "(await import('./package.json')).name")
Expand All @@ -55,20 +63,20 @@ jobs:
echo NAME=$NAME >> $GITHUB_ENV
echo DISPLAY_NAME=$DISPLAY_NAME >> $GITHUB_ENV
- name: Build βš’οΈ
- name: βš’οΈ Build
run: bun run build

- name: Push tags πŸ“Œ
- name: πŸ“Œ Push tags
run: git push

- name: Release ${{ env.VERSION }} πŸ”†
- name: πŸ”† Release ${{ env.VERSION }}
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.VERSION }}
name: ${{ env.DISPLAY_NAME }} v${{ env.VERSION }}
generate_release_notes: true

- name: Publish to NPM Registry 🌐
- name: 🌐 Publish to NPM Registry
run: |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
npm publish --provenance --access public

0 comments on commit 00a6139

Please sign in to comment.