Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 49 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ concurrency:
cancel-in-progress: true

permissions:
contents: write # to be able to publish a GitHub release
id-token: write # to enable use of OIDC for npm provenance
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
contents: read

jobs:
test:
Expand Down Expand Up @@ -51,35 +48,66 @@ jobs:
- name: 💪 Typecheck
run: npm run typecheck

release:
name: 🚀 Release
build-release-artifact:
name: 📦 Build release artifact
needs: [test, typecheck]
runs-on: ubuntu-latest
environment:
name: production
if:
${{ github.repository == 'epicweb-dev/epicli' &&
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
permissions:
contents: read
if: ${{ github.repository == 'epicweb-dev/epicli' && github.event_name == 'push' }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5

- name: ⎔ Setup node
uses: actions/setup-node@v6
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24
package-manager-cache: false

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: Install deps
run: npm install --ignore-scripts

- name: 🏗️ Build
- name: Prepare package
run: npm run build

- name: Upload package artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: npm-package-artifact
path: dist
if-no-files-found: error
retention-days: 7

release:
name: 🚀 Release
needs: [build-release-artifact]
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
id-token: write # to enable use of OIDC for npm provenance
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
if: ${{ github.repository == 'epicweb-dev/epicli' && github.event_name == 'push' }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5

- name: ⎔ Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
package-manager-cache: false

- name: Download package artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: npm-package-artifact
path: .

- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v5.0.2
uses: cycjimmy/semantic-release-action@ba330626c4750c19d8299de843f05c7aa5574f62 # v5.0.2
with:
semantic_version: 25
branches: |
Expand All @@ -94,3 +122,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
NPM_CONFIG_IGNORE_SCRIPTS: true