Skip to content

Commit 744fcaf

Browse files
committed
ci: Add release workflow
1 parent 8cb2648 commit 744fcaf

File tree

5 files changed

+61
-27
lines changed

5 files changed

+61
-27
lines changed

.github/workflows/release-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: release
1+
name: release-pr
22

33
on:
44
push:

.github/workflows/release-tag.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
# Remove default permissions of GITHUB_TOKEN for security
9+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
10+
permissions: {}
11+
12+
jobs:
13+
release:
14+
if: github.repository == 'CodeDredd/pinia-orm' && startsWith(github.event.head_commit.message, 'v1.')
15+
permissions:
16+
id-token: write
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 20
19+
steps:
20+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
21+
with:
22+
fetch-depth: 0
23+
- run: corepack enable
24+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
25+
with:
26+
node-version: 20
27+
registry-url: "https://registry.npmjs.org/"
28+
cache: "pnpm"
29+
30+
- name: Install dependencies
31+
run: pnpm install
32+
33+
- name: Build (stub)
34+
run: pnpm build:stub
35+
36+
- name: Release
37+
run: ./scripts/release.sh
38+
env:
39+
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
40+
NPM_CONFIG_PROVENANCE: true

scripts/release-edge.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ fi
2020

2121
# Release packages
2222
for p in packages/* ; do
23-
if [[ $p == "packages/nuxt" ]] ; then
24-
continue
25-
fi
2623
pushd $p
2724
echo "Publishing $p"
2825
cp ../../LICENSE .

scripts/release.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Restore all git changes
6+
git restore -s@ -SW -- packages examples
7+
8+
# Build all once to ensure things are nice
9+
pnpm build
10+
11+
# Release packages
12+
for PKG in packages/* ; do
13+
pushd $PKG
14+
TAG="latest"
15+
echo "⚡ Publishing $PKG with tag $TAG"
16+
cp ../../LICENSE .
17+
cp ../../README.md .
18+
pnpm publish --access public --no-git-checks --tag $TAG
19+
popd > /dev/null
20+
done

0 commit comments

Comments
 (0)