From 168b825bf46701bc830f0f6f7c05e2db24761ca9 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Fri, 24 Nov 2023 12:09:21 -0500 Subject: [PATCH] Clean Up CI --- .gitea/workflows/build.yml | 18 ++++++++++-------- Jenkinsfile | 37 ------------------------------------- scripts/ci/Dockerfile | 14 -------------- scripts/ci/run.sh | 11 ----------- scripts/ci/simulate.sh | 9 --------- scripts/simulate-ci.sh | 6 ++++++ 6 files changed, 16 insertions(+), 79 deletions(-) delete mode 100644 Jenkinsfile delete mode 100644 scripts/ci/Dockerfile delete mode 100755 scripts/ci/run.sh delete mode 100755 scripts/ci/simulate.sh create mode 100755 scripts/simulate-ci.sh diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index bcc20bf6d..3f92b5d04 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -17,6 +17,11 @@ jobs: uses: actions/checkout@v3 with: submodules: true + # Dependencies + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: '>=1.20.1' - name: Install CMake run: | echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list @@ -24,19 +29,16 @@ jobs: apt-get install --no-install-recommends -y -t buster-backports cmake - name: Install Dependencies run: ./scripts/install-dependencies.sh amd64 armhf arm64 + # Build - name: Build - run: | - chmod +x ./scripts/ci/run.sh - ./scripts/ci/run.sh + run: ./scripts/package-all.sh + - name: Test + run: ./scripts/test.sh - name: Upload Artifacts uses: actions/upload-artifact@v3 with: path: ./out/*.AppImage* - - name: Setup Go - uses: actions/setup-go@v4 - if: startsWith(github.ref, 'refs/tags/') - with: - go-version: '>=1.20.1' + # Create Release - name: Create Release uses: https://gitea.com/actions/release-action@main if: startsWith(github.ref, 'refs/tags/') diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index ad2dc96ae..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,37 +0,0 @@ -pipeline { - agent none - stages { - stage('Debian Buster') { - agent { - dockerfile { - filename 'scripts/ci/Dockerfile' - args '-v /var/run/docker.sock:/var/run/docker.sock --network host' - } - } - stages { - stage('Build') { - steps { - sh './scripts/ci/run.sh' - } - post { - success { - archiveArtifacts artifacts: 'out/*.AppImage*', fingerprint: true - } - } - } - stage('Publish') { - steps { - sh 'apt-get update && apt-get install -y docker.io' - sh 'rm -rf ./out/server-amd64' - sh './scripts/build.sh server amd64' - sh 'docker build --no-cache --tag thebrokenrail/minecraft-pi-reborn-server .' - withCredentials([usernamePassword(credentialsId: 'docker_hub_login', usernameVariable: 'DOCKER_HUB_USERNAME', passwordVariable: 'DOCKER_HUB_PASSWORD')]) { - sh 'docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"' - } - sh 'docker push thebrokenrail/minecraft-pi-reborn-server' - } - } - } - } - } -} diff --git a/scripts/ci/Dockerfile b/scripts/ci/Dockerfile deleted file mode 100644 index 54ab87063..000000000 --- a/scripts/ci/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM buildpack-deps:buster - -# Install Updated CMakes -RUN \ - echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list && \ - apt-get update && \ - apt-get install --no-install-recommends -y -t buster-backports cmake && \ - rm -rf /var/lib/apt/lists/* - -# Install -ADD ./scripts/install-dependencies.sh / -RUN \ - /install-dependencies.sh amd64 armhf arm64 && \ - rm -rf /var/lib/apt/lists/* diff --git a/scripts/ci/run.sh b/scripts/ci/run.sh deleted file mode 100755 index 3aa842796..000000000 --- a/scripts/ci/run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -e - -# Build/Package -echo '==== Building & Packaging ====' -./scripts/package-all.sh - -# Test -echo '==== Testing ====' -./scripts/test.sh diff --git a/scripts/ci/simulate.sh b/scripts/ci/simulate.sh deleted file mode 100755 index 957134b2f..000000000 --- a/scripts/ci/simulate.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e - -# Build Docker Image -docker build -f scripts/ci/Dockerfile -t minecraft-pi-reborn-build . - -# Run -docker run --rm -v "$(pwd):/data" -w '/data' -u "$(id -u):$(id -g)" minecraft-pi-reborn-build ./scripts/ci/run.sh diff --git a/scripts/simulate-ci.sh b/scripts/simulate-ci.sh new file mode 100755 index 000000000..c16e0c875 --- /dev/null +++ b/scripts/simulate-ci.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +# Run +act push -W '.gitea/workflows/build.yml'