Skip to content

Commit

Permalink
Add make target for publishing releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Syriiin committed Nov 21, 2023
1 parent fd85ca0 commit 2e15caa
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Difficalcy.Catch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base

LABEL org.opencontainers.image.source https://github.com/Syriiin/difficalcy

WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80
Expand Down
3 changes: 3 additions & 0 deletions Difficalcy.Mania/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base

LABEL org.opencontainers.image.source https://github.com/Syriiin/difficalcy

WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80
Expand Down
3 changes: 3 additions & 0 deletions Difficalcy.Osu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base

LABEL org.opencontainers.image.source https://github.com/Syriiin/difficalcy

WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80
Expand Down
3 changes: 3 additions & 0 deletions Difficalcy.Taiko/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base

LABEL org.opencontainers.image.source https://github.com/Syriiin/difficalcy

WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80
Expand Down
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ COMPOSE_TOOLING_RUN = docker compose -f docker-compose.tooling.yml run --rm --bu
COMPOSE_E2E = docker compose -f docker-compose.yml -f docker-compose.override.e2e.yml
COMPOSE_E2E_RUN = $(COMPOSE_E2E) run --rm --build e2e-test-runner
COMPOSE_APP_DEV = docker compose -f docker-compose.yml -f docker-compose.override.yml
COMPOSE_PUBLISH = docker compose -f docker-compose.yml -f docker-compose.override.publish.yml

help: ## Show this help
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
Expand All @@ -24,3 +25,20 @@ start-dev: build-dev ## Starts development environment

clean-dev: ## Cleans development environment
$(COMPOSE_APP_DEV) down --remove-orphans

# TODO: move gh into tooling container (requires env var considerations)
VERSION =
release: ## Pushes docker images to ghcr.io and create a github release
ifndef VERSION
$(error VERSION is undefined)
endif
ifndef GITHUB_PAT
$(error GITHUB_PAT env var is not set)
endif
ifndef GITHUB_USERNAME
$(error GITHUB_USERNAME env var is not set)
endif
echo $$GITHUB_PAT | docker login ghcr.io --username $$GITHUB_USERNAME --password-stdin
VERSION=$(VERSION) $(COMPOSE_PUBLISH) build
VERSION=$(VERSION) $(COMPOSE_PUBLISH) push difficalcy-osu difficalcy-taiko difficalcy-catch difficalcy-mania
gh release create "$(VERSION)" --generate-notes
12 changes: 12 additions & 0 deletions docker-compose.override.publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
difficalcy-osu:
image: ghcr.io/syriiin/difficalcy-osu:${VERSION}

difficalcy-taiko:
image: ghcr.io/syriiin/difficalcy-taiko:${VERSION}

difficalcy-catch:
image: ghcr.io/syriiin/difficalcy-catch:${VERSION}

difficalcy-mania:
image: ghcr.io/syriiin/difficalcy-mania:${VERSION}
6 changes: 6 additions & 0 deletions tooling.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base

RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y

WORKDIR /app

COPY Difficalcy.sln .
Expand Down

0 comments on commit 2e15caa

Please sign in to comment.