4 Commits

Author SHA1 Message Date
Takumi Sueda
50faa95938 GitHub Actions: rewrite
Parallel native build, no more hacks, and upload it in the last step
2026-04-13 05:19:19 +09:00
Takumi Sueda
bc9331f069 Run GitHub Actions workflow on Ubuntu 24.04 2026-04-13 04:34:54 +09:00
Takumi Sueda
b15b33902b mingw: enable and fix gprof 2026-04-13 04:34:54 +09:00
Takumi Sueda
cebe6feddd Change MinGW's upstream to a fork
to enable gprof
2026-04-13 01:28:44 +09:00
3 changed files with 46 additions and 91 deletions

View File

@@ -6,109 +6,64 @@ on:
tags: '*' tags: '*'
jobs: jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: false
- name: Generate release name
id: release_name
# https://github.community/t/how-to-get-just-the-tag-name/16241/4
run: echo ::set-output name=name::${GITHUB_REF/refs\/*s\//}
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release_name.outputs.name }}
release_name: ${{ steps.release_name.outputs.name }}
body: ''
draft: false
prerelease: true
build: build:
name: Build name: Build (${{ matrix.arch }})
runs-on: ubuntu-20.04 runs-on: ${{ matrix.runner }}
needs: [create_release] strategy:
matrix:
include:
- arch: x86_64
runner: ubuntu-24.04
- arch: aarch64
runner: ubuntu-24.04-arm
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Make /opt writable and create dir - name: Make /opt writable and create dir
run: sudo chown "$(whoami):$(whoami)" /opt && mkdir /opt/cegcc run: sudo chown "$(whoami):$(whoami)" /opt && mkdir /opt/cegcc
- name: Workaround for apt update failure
run: sudo rm /etc/apt/sources.list.d/github_git-lfs.*
- name: Install deps - name: Install deps
run: | run: |
sudo sed -i 's+^deb http://azure+deb [arch=amd64] http://azure+g' /etc/apt/sources.list sudo apt-get update
cat <<EOF >> aarch64.list sudo apt-get install -y build-essential bison flex m4 libgmp-dev libmpc-dev libmpfr-dev zip
deb [arch=arm64] http://ports.ubuntu.com/ focal main restricted - name: Build cegcc
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ focal universe
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates universe
deb [arch=arm64] http://ports.ubuntu.com/ focal multiverse
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates multiverse
deb [arch=arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse
EOF
sudo mv aarch64.list /etc/apt/sources.list.d/
sudo dpkg --add-architecture arm64
sudo apt update
sudo apt install build-essential bison flex m4 libgmp-dev libmpc-dev libmpfr-dev \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libgmp-dev:arm64 libmpc-dev:arm64 libmpfr-dev:arm64 qemu-user-static
- name: Build cegcc for x86_64
run: | run: |
export DIR=$(pwd)
mkdir build mkdir build
cd build cd build
../build.sh -j4 ../build.sh -j4
cd /opt/cegcc cd /opt/cegcc
find . | xargs file | grep "not stripped" | grep -oE '^[^:]+' | xargs strip find . | xargs file | grep "not stripped" | grep -oE '^[^:]+' | xargs strip
cd /opt cd /opt
zip -r $DIR/cegcc-x86_64.zip cegcc zip -r "$GITHUB_WORKSPACE/cegcc-${{ matrix.arch }}.zip" cegcc
rm -rf cegcc - name: Upload artifact
- name: Build cegcc for aarch64 uses: actions/upload-artifact@v4
run: |
export DIR=$(pwd)
mkdir cross
cd cross
find /usr/bin/aarch64-linux-gnu-* | sed 's+/usr/bin/aarch64-linux-gnu-++g' | xargs -n1 -I{} ln -s /usr/bin/aarch64-linux-gnu-{} {}
ln -s ../build/gcc-bootstrap/gcc/xgcc arm-mingw32ce-gcc # dirty workaround to fix "command not found"
export PATH=$(pwd):$PATH
cd ..
rm -rf build
mkdir build
cd build
../build.sh -j4 --host=aarch64-linux-gnu
cd /opt/cegcc
find . | xargs file | grep "not stripped" | grep -oE '^[^:]+' | xargs /usr/bin/aarch64-linux-gnu-strip
cd /opt
zip -r $DIR/cegcc-aarch64.zip cegcc
- name: Generate archive name
id: archive_name
run: |
echo ::set-output name=name_x86_64::cegcc-x86_64-${GITHUB_REF/refs\/*s\//}
echo ::set-output name=name_aarch64::cegcc-aarch64-${GITHUB_REF/refs\/*s\//}
- name: Upload cegcc-x86_64.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ needs.create_release.outputs.upload_url }} name: cegcc-${{ matrix.arch }}
asset_path: cegcc-x86_64.zip path: cegcc-${{ matrix.arch }}.zip
asset_name: ${{ steps.archive_name.outputs.name_x86_64 }}.zip
asset_content_type: application/zip release:
- name: Upload cegcc-aarch64.zip name: Create release
uses: actions/upload-release-asset@v1 runs-on: ubuntu-latest
env: needs: [build]
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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: with:
upload_url: ${{ needs.create_release.outputs.upload_url }} name: ${{ steps.release_name.outputs.name }}
asset_path: cegcc-aarch64.zip prerelease: true
asset_name: ${{ steps.archive_name.outputs.name_aarch64 }}.zip files: |
asset_content_type: application/zip cegcc-x86_64-${{ steps.release_name.outputs.name }}.zip
cegcc-aarch64-${{ steps.release_name.outputs.name }}.zip

2
.gitmodules vendored
View File

@@ -9,4 +9,4 @@
url = ../../MaxKellermann/gcc url = ../../MaxKellermann/gcc
[submodule "mingw"] [submodule "mingw"]
path = mingw path = mingw
url = ../../MaxKellermann/mingwrt url = ../../brain-hackers/mingwrt

2
mingw

Submodule mingw updated: cd5f3e6465...36b264ed82