name: Build on: push: branches: 'ci*' tags: '*' jobs: build: name: Build (${{ matrix.arch }}) runs-on: ${{ matrix.runner }} strategy: matrix: include: - arch: x86_64 runner: ubuntu-24.04 - arch: aarch64 runner: ubuntu-24.04-arm steps: - uses: actions/checkout@v4 with: submodules: true - name: Make /opt writable and create dir run: sudo chown "$(whoami):$(whoami)" /opt && mkdir /opt/cegcc - name: Install deps run: | sudo apt-get update sudo apt-get install -y build-essential bison flex m4 libgmp-dev libmpc-dev libmpfr-dev zip - name: Build cegcc run: | mkdir build cd build ../build.sh -j4 cd /opt/cegcc find . | xargs file | grep "not stripped" | grep -oE '^[^:]+' | xargs strip cd /opt zip -r "$GITHUB_WORKSPACE/cegcc-${{ matrix.arch }}.zip" cegcc - name: Upload artifact uses: actions/upload-artifact@v4 with: name: cegcc-${{ matrix.arch }} path: cegcc-${{ matrix.arch }}.zip release: name: Create release runs-on: ubuntu-latest needs: [build] if: startsWith(github.ref, 'refs/tags/') permissions: contents: write steps: - name: Download artifacts uses: actions/download-artifact@v4 - name: Generate release name id: release_name run: echo "name=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT" - name: Rename artifacts run: | TAG="${GITHUB_REF#refs/*/}" mv cegcc-x86_64/cegcc-x86_64.zip "cegcc-x86_64-${TAG}.zip" mv cegcc-aarch64/cegcc-aarch64.zip "cegcc-aarch64-${TAG}.zip" - name: Create release and upload assets uses: softprops/action-gh-release@v2 with: name: ${{ steps.release_name.outputs.name }} prerelease: true files: | cegcc-x86_64-${{ steps.release_name.outputs.name }}.zip cegcc-aarch64-${{ steps.release_name.outputs.name }}.zip