-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (59 loc) · 1.85 KB
/
release.yml
File metadata and controls
63 lines (59 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
packages: write
id-token: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
registry-url: https://registry.npmjs.org
- run: pnpm install --frozen-lockfile
- run: pnpm run release:check
- name: Pack CLI
run: pnpm --filter crewcmd exec npm pack --pack-destination "$GITHUB_WORKSPACE"
- name: Build server bundle
run: pnpm run release:server:dry-run
- name: Docker login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
${{ env.REGISTRY_IMAGE }}:latest
- name: Generate release notes
run: |
if ! pnpm run --silent release:notes > RELEASE_NOTES.md || [ ! -s RELEASE_NOTES.md ]; then
echo "## Changes" > RELEASE_NOTES.md
git log --oneline "$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo HEAD~20)"..HEAD >> RELEASE_NOTES.md
fi
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${GITHUB_REF_NAME}" \
--notes-file RELEASE_NOTES.md \
crewcmd-*.tgz \
.release-dry-run/crewcmd-server-"${GITHUB_REF_NAME}".tar.gz