From d8e630b6f19c7383d19329deea69ca06891f4bc5 Mon Sep 17 00:00:00 2001 From: A2va <49582555+A2va@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:46:13 +0100 Subject: [PATCH 1/9] Re-add cosmocc actions --- .github/workflows/cosmocc.yml | 62 +++++++++++++++++++++++++++ .github/workflows/cosmocc_macos.yml | 66 +++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 .github/workflows/cosmocc.yml create mode 100644 .github/workflows/cosmocc_macos.yml diff --git a/.github/workflows/cosmocc.yml b/.github/workflows/cosmocc.yml new file mode 100644 index 0000000000..30d68d07c9 --- /dev/null +++ b/.github/workflows/cosmocc.yml @@ -0,0 +1,62 @@ +name: Cosmocc (linux-x86_64) + +on: + pull_request: + push: + release: + types: [published] + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest] + arch: [x86_64] + + runs-on: ${{ matrix.os }} + + concurrency: + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-${{ matrix.arch }} + cancel-in-progress: true + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Prepare local xmake + run: cp -rf . ../xmake-source + + - uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: local#../xmake-source + + - uses: bjia56/setup-cosmocc@main + with: + version: "4.0.2" + + - name: Build + run: | + cd core + xmake f -p linux --cosmocc=y --embed=y -y -cvD + xmake -v + cd .. + + - name: Prepare + run: | + sudo apt update + sudo apt install -y ruby ruby-dev rubygems build-essential llvm libc++-dev + sudo apt install -y libgl1-mesa-dev libglu1-mesa-dev + clang --version + + - name: Tests + run: | + ls -l core/build/ + core/build/xmake --version + core/build/xmake lua -v -D tests/run.lua + + - name: Artifact + uses: actions/upload-artifact@v4 + with: + name: xmake-cosmocc + path: core/build/xmake \ No newline at end of file diff --git a/.github/workflows/cosmocc_macos.yml b/.github/workflows/cosmocc_macos.yml new file mode 100644 index 0000000000..11f47c90f8 --- /dev/null +++ b/.github/workflows/cosmocc_macos.yml @@ -0,0 +1,66 @@ +name: Cosmocc (macos-x86_64) + +on: + pull_request: + push: + release: + types: [published] +jobs: + build: + strategy: + matrix: + os: [macos-13] + arch: [x86_64] + + runs-on: ${{ matrix.os }} + + concurrency: + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-${{ matrix.arch }} + cancel-in-progress: true + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Prepare local xmake + run: cp -rf . ../xmake-source + + - uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: local#../xmake-source + + - uses: bjia56/setup-cosmocc@main + with: + version: "4.0.2" + + - name: Installation + run: | + brew install dmd + brew install dub + + - name: Build + run: | + cd core + xmake f -p linux --cosmocc=y --embed=y -y -cvD + xmake -v + cd .. + + # In the tests, cmake tries to use make from the cosmopolitan toolchain and fails, so uninstall it + - name: Remove cosmocc + run: | + INSTALL_DIR="${{runner.temp}}/cosmocc-4.0.2" + echo "Removing cosmocc from PATH" + echo "::remove-path::${INSTALL_DIR}/bin" + rm -r "${INSTALL_DIR}" + + - name: Tests + run: | + ls -l core/build/ + core/build/xmake --version + core/build/xmake lua -v -D tests/run.lua + + - name: Artifact + uses: actions/upload-artifact@v4 + with: + name: xmake-cosmocc + path: core/build/xmake \ No newline at end of file From f1eae451650414b6b1f3ebb69fc6d9614f378ecd Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 16 Jan 2025 23:10:31 +0800 Subject: [PATCH 2/9] Update cosmocc.yml --- .github/workflows/cosmocc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cosmocc.yml b/.github/workflows/cosmocc.yml index 30d68d07c9..f0e0ce479d 100644 --- a/.github/workflows/cosmocc.yml +++ b/.github/workflows/cosmocc.yml @@ -16,7 +16,7 @@ jobs: runs-on: ${{ matrix.os }} concurrency: - group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-${{ matrix.arch }} + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-Linux-${{ matrix.arch }} cancel-in-progress: true steps: @@ -59,4 +59,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: xmake-cosmocc - path: core/build/xmake \ No newline at end of file + path: core/build/xmake From a13a14716d315a3e102420bb788521aa445b81c4 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 16 Jan 2025 23:11:04 +0800 Subject: [PATCH 3/9] Update cosmocc_macos.yml --- .github/workflows/cosmocc_macos.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cosmocc_macos.yml b/.github/workflows/cosmocc_macos.yml index 11f47c90f8..fc2ad11b2c 100644 --- a/.github/workflows/cosmocc_macos.yml +++ b/.github/workflows/cosmocc_macos.yml @@ -1,4 +1,4 @@ -name: Cosmocc (macos-x86_64) +name: Cosmocc (macOS) on: pull_request: @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} concurrency: - group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-${{ matrix.arch }} + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-macOS-${{ matrix.arch }} cancel-in-progress: true steps: - uses: actions/checkout@v2 @@ -63,4 +63,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: xmake-cosmocc - path: core/build/xmake \ No newline at end of file + path: core/build/xmake From a4934a2c00d9ae14b4e32c163b8d87f99a81fb78 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jan 2025 21:42:37 +0800 Subject: [PATCH 4/9] Update cosmocc.yml --- .github/workflows/cosmocc.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cosmocc.yml b/.github/workflows/cosmocc.yml index f0e0ce479d..0670beca86 100644 --- a/.github/workflows/cosmocc.yml +++ b/.github/workflows/cosmocc.yml @@ -1,4 +1,4 @@ -name: Cosmocc (linux-x86_64) +name: Cosmocc on: pull_request: @@ -10,13 +10,13 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, macos-13] arch: [x86_64] runs-on: ${{ matrix.os }} concurrency: - group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-Linux-${{ matrix.arch }} + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-${{ matrix.os }}-${{ matrix.arch }} cancel-in-progress: true steps: @@ -43,6 +43,7 @@ jobs: cd .. - name: Prepare + if: matrix.os == 'ubuntu-latest' run: | sudo apt update sudo apt install -y ruby ruby-dev rubygems build-essential llvm libc++-dev @@ -54,6 +55,14 @@ jobs: ls -l core/build/ core/build/xmake --version core/build/xmake lua -v -D tests/run.lua + + # In the tests, cmake tries to use make from the cosmopolitan toolchain and fails, so uninstall it + - name: Remove cosmocc + run: | + INSTALL_DIR="${{runner.temp}}/cosmocc-4.0.2" + echo "Removing cosmocc from PATH" + echo "::remove-path::${INSTALL_DIR}/bin" + rm -r "${INSTALL_DIR}" - name: Artifact uses: actions/upload-artifact@v4 From b9402fbb7eee720e1401767a1189cf0c13cfa8f5 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jan 2025 21:43:10 +0800 Subject: [PATCH 5/9] Delete .github/workflows/cosmocc_macos.yml --- .github/workflows/cosmocc_macos.yml | 66 ----------------------------- 1 file changed, 66 deletions(-) delete mode 100644 .github/workflows/cosmocc_macos.yml diff --git a/.github/workflows/cosmocc_macos.yml b/.github/workflows/cosmocc_macos.yml deleted file mode 100644 index fc2ad11b2c..0000000000 --- a/.github/workflows/cosmocc_macos.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Cosmocc (macOS) - -on: - pull_request: - push: - release: - types: [published] -jobs: - build: - strategy: - matrix: - os: [macos-13] - arch: [x86_64] - - runs-on: ${{ matrix.os }} - - concurrency: - group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-macOS-${{ matrix.arch }} - cancel-in-progress: true - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - - name: Prepare local xmake - run: cp -rf . ../xmake-source - - - uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: local#../xmake-source - - - uses: bjia56/setup-cosmocc@main - with: - version: "4.0.2" - - - name: Installation - run: | - brew install dmd - brew install dub - - - name: Build - run: | - cd core - xmake f -p linux --cosmocc=y --embed=y -y -cvD - xmake -v - cd .. - - # In the tests, cmake tries to use make from the cosmopolitan toolchain and fails, so uninstall it - - name: Remove cosmocc - run: | - INSTALL_DIR="${{runner.temp}}/cosmocc-4.0.2" - echo "Removing cosmocc from PATH" - echo "::remove-path::${INSTALL_DIR}/bin" - rm -r "${INSTALL_DIR}" - - - name: Tests - run: | - ls -l core/build/ - core/build/xmake --version - core/build/xmake lua -v -D tests/run.lua - - - name: Artifact - uses: actions/upload-artifact@v4 - with: - name: xmake-cosmocc - path: core/build/xmake From aa7b845d9eb14c7d6f4028a818e945787371dee2 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jan 2025 21:45:44 +0800 Subject: [PATCH 6/9] Update cosmocc.yml --- .github/workflows/cosmocc.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cosmocc.yml b/.github/workflows/cosmocc.yml index 0670beca86..f70c620827 100644 --- a/.github/workflows/cosmocc.yml +++ b/.github/workflows/cosmocc.yml @@ -42,13 +42,19 @@ jobs: xmake -v cd .. - - name: Prepare + - name: Prepare (Linux) if: matrix.os == 'ubuntu-latest' run: | sudo apt update sudo apt install -y ruby ruby-dev rubygems build-essential llvm libc++-dev sudo apt install -y libgl1-mesa-dev libglu1-mesa-dev clang --version + + - name: Prepare (macOS) + if: matrix.os == 'macos-13' + run: | + brew install dmd + brew install dub - name: Tests run: | @@ -67,5 +73,5 @@ jobs: - name: Artifact uses: actions/upload-artifact@v4 with: - name: xmake-cosmocc + name: xmake-bundle.cosmocc path: core/build/xmake From 18d9b70153d64b507b7c2e501e523d40df439031 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jan 2025 21:49:08 +0800 Subject: [PATCH 7/9] Update cosmocc.yml --- .github/workflows/cosmocc.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cosmocc.yml b/.github/workflows/cosmocc.yml index f70c620827..705dfa958e 100644 --- a/.github/workflows/cosmocc.yml +++ b/.github/workflows/cosmocc.yml @@ -23,6 +23,9 @@ jobs: - uses: actions/checkout@v2 with: submodules: true + + - uses: little-core-labs/get-git-tag@v3.0.2 + id: tagName - name: Prepare local xmake run: cp -rf . ../xmake-source @@ -71,7 +74,19 @@ jobs: rm -r "${INSTALL_DIR}" - name: Artifact + if: matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v4 with: - name: xmake-bundle.cosmocc + name: xmake-bundle.cosmocc.x86_64 path: core/build/xmake + + - name: Publish bundle binary + if: github.event.action == 'published' && matrix.os == 'ubuntu-latest' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: core/build/xmake + asset_name: xmake-bundle-${{ steps.tagName.outputs.tag }}.cosmocc.x86_64 + asset_content_type: application/zip From 01c12efdd61c23cc36bb746cd3c72311d10ae854 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jan 2025 21:59:56 +0800 Subject: [PATCH 8/9] Update cosmocc.yml --- .github/workflows/cosmocc.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cosmocc.yml b/.github/workflows/cosmocc.yml index 705dfa958e..a8ec237e72 100644 --- a/.github/workflows/cosmocc.yml +++ b/.github/workflows/cosmocc.yml @@ -59,12 +59,6 @@ jobs: brew install dmd brew install dub - - name: Tests - run: | - ls -l core/build/ - core/build/xmake --version - core/build/xmake lua -v -D tests/run.lua - # In the tests, cmake tries to use make from the cosmopolitan toolchain and fails, so uninstall it - name: Remove cosmocc run: | @@ -73,6 +67,12 @@ jobs: echo "::remove-path::${INSTALL_DIR}/bin" rm -r "${INSTALL_DIR}" + - name: Tests + run: | + ls -l core/build/ + core/build/xmake --version + core/build/xmake lua -v -D tests/run.lua + - name: Artifact if: matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v4 From c15679521b694e7112c9e6d5ee0f5a3e70c366a6 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jan 2025 22:05:31 +0800 Subject: [PATCH 9/9] Update cosmocc.yml --- .github/workflows/cosmocc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cosmocc.yml b/.github/workflows/cosmocc.yml index a8ec237e72..74429e1770 100644 --- a/.github/workflows/cosmocc.yml +++ b/.github/workflows/cosmocc.yml @@ -61,6 +61,7 @@ jobs: # In the tests, cmake tries to use make from the cosmopolitan toolchain and fails, so uninstall it - name: Remove cosmocc + if: matrix.os == 'macos-13' run: | INSTALL_DIR="${{runner.temp}}/cosmocc-4.0.2" echo "Removing cosmocc from PATH"