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 uses: actions/checkout@v3
with: with:
submodules: true submodules: true
# Dependencies
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '>=1.20.1'
- name: Install CMake - name: Install CMake
run: | run: |
echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list 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 apt-get install --no-install-recommends -y -t buster-backports cmake
- name: Install Dependencies - name: Install Dependencies
run: ./scripts/install-dependencies.sh amd64 armhf arm64 run: ./scripts/install-dependencies.sh amd64 armhf arm64
# Build
- name: Build - name: Build
run: | run: ./scripts/package-all.sh
chmod +x ./scripts/ci/run.sh - name: Test
./scripts/ci/run.sh run: ./scripts/test.sh
- name: Upload Artifacts - name: Upload Artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
path: ./out/*.AppImage* path: ./out/*.AppImage*
- name: Setup Go # Create Release
uses: actions/setup-go@v4
if: startsWith(github.ref, 'refs/tags/')
with:
go-version: '>=1.20.1'
- name: Create Release - name: Create Release
uses: https://gitea.com/actions/release-action@main uses: https://gitea.com/actions/release-action@main
if: startsWith(github.ref, 'refs/tags/') 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'