-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (51 loc) · 2.37 KB
/
Dockerfile
File metadata and controls
55 lines (51 loc) · 2.37 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
# ─────────────────────────────────────────────────────────────────────────────
# tcwlab / semantic-release
#
# semantic-release with Forgejo support via @semantic-release/github.
# Forgejo has a GitHub-compatible API — release creation and tag push
# work directly with these env vars:
#
# GH_TOKEN → Forgejo API token (secrets.FORGEJO_TOKEN)
# GITHUB_URL → https://<your-forgejo-host> (e.g. https://forgejo.example.com)
# GITHUB_API_URL → https://<your-forgejo-host>/api/v1/ (e.g. https://forgejo.example.com/api/v1/)
#
# Included plugins:
# @semantic-release/commit-analyzer → Conventional Commits → SemVer
# @semantic-release/release-notes-generator → Changelog from commits
# @semantic-release/github → Forgejo release + tag
# @semantic-release/exec → Write version to file
#
# Docker tags: tcwlab/semantic-release:<semrel-version>-<wrapper-semver>
# ─────────────────────────────────────────────────────────────────────────────
ARG SEMANTIC_RELEASE_VERSION=25.0.3
FROM node:lts-alpine AS base
# hadolint ignore=DL3018
RUN apk add --no-cache \
git \
git-lfs \
ca-certificates \
curl \
bash \
&& apk upgrade \
&& rm -rf /var/cache/apk/*
FROM base AS deps
ARG SEMANTIC_RELEASE_VERSION
RUN npm install -g \
"semantic-release@${SEMANTIC_RELEASE_VERSION}" \
"@semantic-release/commit-analyzer@13" \
"@semantic-release/release-notes-generator@14" \
"@semantic-release/github@11" \
"@semantic-release/exec@6" \
"picomatch@4.0.4" \
&& find /usr/local/lib/node_modules -mindepth 3 \
-name "picomatch" -type d \
-not -path "/usr/local/lib/node_modules/picomatch" \
-exec rm -rf {} + \
&& npm cache clean --force
FROM base AS release
COPY --from=deps /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN ln -s /usr/local/lib/node_modules/semantic-release/bin/semantic-release.js \
/usr/local/bin/semantic-release
RUN addgroup -S semrel && adduser -S semrel -G semrel
USER semrel
CMD ["semantic-release", "--help"]