From d2f43e4e505cd42e8f66404a574dae840bd5ed20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Wed, 29 May 2024 14:28:18 +0200 Subject: [PATCH] CI: Misc --- .github/workflows/docker-publish-latest.yml | 14 +++----------- .github/workflows/docker-publish-main.yml | 14 +++----------- .github/workflows/docker-publish-released.yml | 14 +++----------- Dockerfile | 8 +++++++- Dockerfile.Service | 8 +++++++- 5 files changed, 23 insertions(+), 35 deletions(-) diff --git a/.github/workflows/docker-publish-latest.yml b/.github/workflows/docker-publish-latest.yml index 722ab9b3a..28f360aba 100644 --- a/.github/workflows/docker-publish-latest.yml +++ b/.github/workflows/docker-publish-latest.yml @@ -5,7 +5,6 @@ on: types: [released] env: - ASF_PRIVATE_SNK: ${{ secrets.ASF_PRIVATE_SNK }} PLATFORMS: linux/amd64,linux/arm,linux/arm64 TAG: latest @@ -40,15 +39,6 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Prepare private key for signing - shell: sh - run: | - set -eu - - if [ -n "${ASF_PRIVATE_SNK-}" ]; then - echo "$ASF_PRIVATE_SNK" | base64 -d > "resources/ArchiSteamFarm.snk" - fi - - name: Prepare environment outputs shell: sh run: | @@ -67,7 +57,9 @@ jobs: platforms: ${{ env.PLATFORMS }} provenance: true sbom: true - secrets: STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }} + secrets: | + ASF_PRIVATE_SNK=${{ secrets.ASF_PRIVATE_SNK }} + STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }} labels: | org.opencontainers.image.created=${{ env.DATE_ISO8601 }} org.opencontainers.image.version=${{ env.FIXED_TAG }} diff --git a/.github/workflows/docker-publish-main.yml b/.github/workflows/docker-publish-main.yml index 2008d7381..9440c5222 100644 --- a/.github/workflows/docker-publish-main.yml +++ b/.github/workflows/docker-publish-main.yml @@ -6,7 +6,6 @@ on: - main env: - ASF_PRIVATE_SNK: ${{ secrets.ASF_PRIVATE_SNK }} PLATFORMS: linux/amd64,linux/arm,linux/arm64 TAG: main @@ -41,15 +40,6 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Prepare private key for signing - shell: sh - run: | - set -eu - - if [ -n "${ASF_PRIVATE_SNK-}" ]; then - echo "$ASF_PRIVATE_SNK" | base64 -d > "resources/ArchiSteamFarm.snk" - fi - - name: Prepare environment outputs shell: sh run: | @@ -66,7 +56,9 @@ jobs: platforms: ${{ env.PLATFORMS }} provenance: true sbom: true - secrets: STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }} + secrets: | + ASF_PRIVATE_SNK=${{ secrets.ASF_PRIVATE_SNK }} + STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }} labels: | org.opencontainers.image.created=${{ env.DATE_ISO8601 }} org.opencontainers.image.version=${{ github.sha }} diff --git a/.github/workflows/docker-publish-released.yml b/.github/workflows/docker-publish-released.yml index f1e2cf18f..50c1a55ed 100644 --- a/.github/workflows/docker-publish-released.yml +++ b/.github/workflows/docker-publish-released.yml @@ -6,7 +6,6 @@ on: - '*' env: - ASF_PRIVATE_SNK: ${{ secrets.ASF_PRIVATE_SNK }} PLATFORMS: linux/amd64,linux/arm,linux/arm64 TAG: released @@ -41,15 +40,6 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Prepare private key for signing - shell: sh - run: | - set -eu - - if [ -n "${ASF_PRIVATE_SNK-}" ]; then - echo "$ASF_PRIVATE_SNK" | base64 -d > "resources/ArchiSteamFarm.snk" - fi - - name: Prepare environment outputs shell: sh run: | @@ -67,7 +57,9 @@ jobs: platforms: ${{ env.PLATFORMS }} provenance: true sbom: true - secrets: STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }} + secrets: | + ASF_PRIVATE_SNK=${{ secrets.ASF_PRIVATE_SNK }} + STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }} labels: | org.opencontainers.image.created=${{ env.DATE_ISO8601 }} org.opencontainers.image.version=${{ env.FIXED_TAG }} diff --git a/Dockerfile b/Dockerfile index c77426274..9936425da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ COPY Directory.Build.props Directory.Build.props COPY Directory.Packages.props Directory.Packages.props COPY LICENSE.txt LICENSE.txt -RUN --mount=type=secret,id=STEAM_TOKEN_DUMPER_TOKEN < "resources/ArchiSteamFarm.snk" + else + echo "WARN: No ASF_PRIVATE_SNK provided!" + fi + dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -o "out" -p:ASFVariant=docker -p:ContinuousIntegrationBuild=true -p:UseAppHost=false -r "$asf_variant" --nologo --no-self-contained if [ -f "/run/secrets/STEAM_TOKEN_DUMPER_TOKEN" ]; then diff --git a/Dockerfile.Service b/Dockerfile.Service index e733cf352..320ac8cd7 100644 --- a/Dockerfile.Service +++ b/Dockerfile.Service @@ -34,7 +34,7 @@ COPY Directory.Build.props Directory.Build.props COPY Directory.Packages.props Directory.Packages.props COPY LICENSE.txt LICENSE.txt -RUN --mount=type=secret,id=STEAM_TOKEN_DUMPER_TOKEN < "resources/ArchiSteamFarm.snk" + else + echo "WARN: No ASF_PRIVATE_SNK provided!" + fi + dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -o "out" "-p:ASFVariant=${asf_variant}" -p:ContinuousIntegrationBuild=true -p:PublishSingleFile=true -p:PublishTrimmed=true -r "$asf_variant" --nologo --self-contained if [ -f "/run/secrets/STEAM_TOKEN_DUMPER_TOKEN" ]; then