1
0
mirror of https://github.com/renbaoshuo/s2oj-gcc.git synced 2024-12-13 13:26:23 +00:00
s2oj-gcc/.github/workflows/build.yml
2023-11-17 06:38:49 +08:00

42 lines
1.3 KiB
YAML

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