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