diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index bcc20bf..3f92b5d 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 ad2dc96..0000000 --- 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 54ab870..0000000 --- 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 3aa8427..0000000 --- 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 957134b..0000000 --- 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 0000000..c16e0c8 --- /dev/null +++ b/scripts/simulate-ci.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +# Run +act push -W '.gitea/workflows/build.yml'