Clean Up CI

This commit is contained in:
TheBrokenRail 2023-11-24 12:09:21 -05:00
parent edca3ad394
commit 168b825bf4
6 changed files with 16 additions and 79 deletions

View File

@ -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/')

37
Jenkinsfile vendored
View File

@ -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'
}
}
}
}
}
}

View File

@ -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/*

View File

@ -1,11 +0,0 @@
#!/bin/sh
set -e
# Build/Package
echo '==== Building & Packaging ===='
./scripts/package-all.sh
# Test
echo '==== Testing ===='
./scripts/test.sh

View File

@ -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

6
scripts/simulate-ci.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
# Run
act push -W '.gitea/workflows/build.yml'