Skip to content

Commit

Permalink
Migrate metadata tester build from Cake to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed May 22, 2024
1 parent 6754dd9 commit 26e466d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 37 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,20 @@ jobs:
with:
name: Release-repack-unsigned
path: _build/repack/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Generate metadata tester Docker image and publish to Hub
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
if: ${{ env.DOCKERHUB_USERNAME && env.DOCKERHUB_PASSWORD }}
run: |
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
./build docker-metadata --configuration=Release --exclusive
uses: docker/build-push-action@v5
with:
file: Dockerfile.metadata
context: _build/repack/Release
tags: kspckan/metadata
push: true

notify-discord:
needs:
Expand Down
30 changes: 0 additions & 30 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#addin "nuget:?package=Cake.SemVer&version=4.0.0"
#addin "nuget:?package=semver&version=2.3.0"
#addin "nuget:?package=Cake.Docker&version=0.11.1"
#addin nuget:?package=Cake.Git&version=3.0.0
#tool "nuget:?package=ILRepack&version=2.0.27"
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.16.3"
Expand Down Expand Up @@ -49,35 +48,6 @@ Task("Netkan")
.Description("Build only netkan.exe")
.IsDependentOn("Repack-Netkan");

Task("docker-metadata")
.Description("Build the Docker image for the metadata testing and push it to Dockerhub.")
.IsDependentOn("Repack-Netkan")
.IsDependentOn("Repack-Ckan")
.Does(() =>
{
var dockerDirectory = buildDirectory.Combine("docker");
var metadataDirectory = dockerDirectory.Combine("metadata");
// Versions of Docker prior to 18.03.0-ce require the Dockerfile to be within the build context
var dockerFile = metadataDirectory.CombineWithFilePath("Dockerfile.metadata");
CreateDirectory(metadataDirectory);
CopyFile(netkanFile, metadataDirectory.CombineWithFilePath("netkan.exe"));
CopyFile(ckanFile, metadataDirectory.CombineWithFilePath("ckan.exe"));
CopyFile(rootDirectory.CombineWithFilePath("Dockerfile.metadata"), dockerFile);
var mainTag = "kspckan/metadata";
var latestTag = mainTag + ":latest";
DockerBuild(
new DockerImageBuildSettings()
{
File = dockerFile.FullPath,
Tag = new string[] { mainTag }
},
metadataDirectory.FullPath
);
DockerTag(mainTag, latestTag);
DockerPush(latestTag);
});

Task("osx")
.Description("Build the macOS(OSX) dmg package.")
.IsDependentOn("Ckan")
Expand Down

0 comments on commit 26e466d

Please sign in to comment.