feat: add release Docker image and Gitea Actions workflow
Add Dockerfile.release using mise to install toolchain, Gitea Actions workflow with snapshot dry-run on main pushes and full release on tags, and mise release-docker task for local testing.
This commit is contained in:
36
.gitea/workflows/release.yaml
Normal file
36
.gitea/workflows/release.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build release image
|
||||
run: docker build -f Dockerfile.release -t gitnow-release .
|
||||
|
||||
- name: Snapshot (dry run)
|
||||
if: startsWith(github.ref, 'refs/tags/') == false
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v "${{ github.workspace }}:/build" \
|
||||
-w /build \
|
||||
gitnow-release release-snapshot
|
||||
|
||||
- name: Release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v "${{ github.workspace }}:/build" \
|
||||
-w /build \
|
||||
-e GITEA_TOKEN=${{ secrets.GITEA_TOKEN }} \
|
||||
gitnow-release release
|
||||
20
Dockerfile.release
Normal file
20
Dockerfile.release
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM debian:trixie-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
git \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install mise
|
||||
RUN curl https://mise.run | sh
|
||||
ENV PATH="/root/.local/bin:${PATH}"
|
||||
|
||||
WORKDIR /build
|
||||
COPY mise.toml .
|
||||
RUN mise trust && mise install
|
||||
|
||||
COPY . .
|
||||
|
||||
ENTRYPOINT ["mise", "run"]
|
||||
CMD ["release"]
|
||||
@@ -19,3 +19,10 @@ description = "Create a release using GoReleaser (requires GITEA_TOKEN and a git
|
||||
[tasks.release-snapshot]
|
||||
run = "goreleaser release --snapshot --clean"
|
||||
description = "Build a local snapshot release without publishing"
|
||||
|
||||
[tasks.release-docker]
|
||||
run = """
|
||||
docker build -f Dockerfile.release -t gitnow-release .
|
||||
docker run --rm -v "$PWD:/build" -w /build -e GITEA_TOKEN gitnow-release release --snapshot --clean
|
||||
"""
|
||||
description = "Test the release Docker image locally (snapshot mode)"
|
||||
|
||||
Reference in New Issue
Block a user