mirror of
https://github.com/renbaoshuo/s2oj-gcc.git
synced 2024-11-12 22:28:44 +00:00
Compare commits
No commits in common. "e092407ee9bcbf83220c9f368a28040d21ee484f" and "883a251310b2e46ce28d16c3bf70d5a492e99001" have entirely different histories.
e092407ee9
...
883a251310
24
.drone.yml
Normal file
24
.drone.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Build
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
- custom
|
||||
|
||||
steps:
|
||||
- name: Build & Upload
|
||||
image: ubuntu:22.04
|
||||
commands:
|
||||
- sed -i 's@//.*archive.ubuntu.com@//mirror-cdn.xtom.com@g' /etc/apt/sources.list &&
|
||||
sed -i 's@//security.ubuntu.com@//mirror-cdn.xtom.com@g' /etc/apt/sources.list
|
||||
- apt update &&
|
||||
apt install -y curl flex bzip2 git make gcc g++ libgmp-dev libmpfr-dev libmpc-dev gcc-multilib
|
||||
- bash build.sh
|
||||
environment:
|
||||
GITEA_ENDPOINT: https://git.m.ac
|
||||
GITEA_USER: baoshuo
|
||||
GITEA_TOKEN:
|
||||
from_secret: GITEA_TOKEN
|
41
.github/workflows/build.yml
vendored
41
.github/workflows/build.yml
vendored
@ -1,41 +0,0 @@
|
||||
name: Build & Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt-get update &&
|
||||
sudo apt-get install -y curl flex bzip2 git make gcc g++ libgmp-dev libmpfr-dev libmpc-dev gcc-multilib
|
||||
- name: Build
|
||||
run: bash build.sh
|
||||
- name: Upload to artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: s2oj-gcc.zip
|
||||
path: deb/
|
||||
- name: Pack
|
||||
run: dpkg-deb --build deb s2oj-gcc-$(cat GCC_VERSION)~1baoshuo1.deb
|
||||
- name: Upload
|
||||
run: |
|
||||
curl --user "${GITEA_USER}:${GITEA_TOKEN}" \
|
||||
--upload-file "s2oj-gcc-$(cat GCC_VERSION)~1baoshuo1.deb" \
|
||||
${GITEA_ENDPOINT}/api/packages/${GITEA_USER}/debian/pool/all/main/upload
|
||||
env:
|
||||
GITEA_ENDPOINT: https://git.m.ac
|
||||
GITEA_USER: baoshuo
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
- name: Get Package Filename
|
||||
id: GetPackageFilename
|
||||
run: echo ::set-output name=filename::s2oj-gcc-$(cat GCC_VERSION)~1baoshuo1.deb
|
||||
- name: Upload to artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: s2oj-gcc.deb
|
||||
path: ${{ steps.GetPackageFilename.outputs.filename }}
|
@ -1 +0,0 @@
|
||||
13.2.0
|
22
build.sh
22
build.sh
@ -1,8 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
CURRENT_DIR=$(pwd)
|
||||
GCC_VERSION=$(cat GCC_VERSION)
|
||||
GCC_GIT="git://gcc.gnu.org/git/gcc.git"
|
||||
GCC_VERSION="13.2.0"
|
||||
# GCC_GIT="git://gcc.gnu.org/git/gcc.git"
|
||||
GCC_GIT="https://git.m.ac/mirrors/gcc.git"
|
||||
GCC_SRC="${CURRENT_DIR}/../gcc"
|
||||
|
||||
build_cd() {
|
||||
@ -10,11 +11,6 @@ build_cd() {
|
||||
echo "****** Now at: $(pwd)"
|
||||
}
|
||||
|
||||
if [ -z "$GCC_VERSION" ]; then
|
||||
echo "GCC_VERSION not set!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Clone GCC
|
||||
echo "===> Cloning GCC..."
|
||||
git clone -b "releases/gcc-$GCC_VERSION" --depth 1 "${GCC_GIT}" "${GCC_SRC}"
|
||||
@ -34,6 +30,7 @@ build_cd ${CURRENT_DIR}
|
||||
# Configure GCC
|
||||
echo "===> Configuring GCC..."
|
||||
build_cd ${CURRENT_DIR}/build
|
||||
echo " Now at: $(pwd)"
|
||||
${GCC_SRC}/configure -v \
|
||||
--enable-languages=c,c++ \
|
||||
--prefix=/usr \
|
||||
@ -46,8 +43,8 @@ ${GCC_SRC}/configure -v \
|
||||
echo "===> Building GCC..."
|
||||
make -j$(nproc)
|
||||
|
||||
# Prepare for packaging
|
||||
echo "===> Preparing for packaging..."
|
||||
# Make .deb package
|
||||
echo "===> Making .deb package \"s2oj-gcc-$GCC_VERSION~1baoshuo1.deb\" ..."
|
||||
make -j$(nproc) DESTDIR=${CURRENT_DIR}/deb install
|
||||
build_cd ${CURRENT_DIR}/deb
|
||||
mkdir -p DEBIAN
|
||||
@ -61,3 +58,10 @@ Maintainer: Baoshuo <i@baoshuo.ren>
|
||||
Description: GCC $GCC_VERSION for S2OJ
|
||||
EOF
|
||||
build_cd ${CURRENT_DIR}
|
||||
dpkg-deb --build deb s2oj-gcc-$GCC_VERSION~1baoshuo1.deb
|
||||
|
||||
# Upload package to Gitea
|
||||
echo "===> Uploading package to Gitea..."
|
||||
curl --user "${GITEA_USER}:${GITEA_TOKEN}" \
|
||||
--upload-file s2oj-gcc-$GCC_VERSION~1baoshuo1.deb \
|
||||
${GITEA_ENDPOINT}/api/packages/${GITEA_USER}/debian/pool/all/main/upload
|
||||
|
0
deb/.gitkeep
Normal file
0
deb/.gitkeep
Normal file
Loading…
Reference in New Issue
Block a user