summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-09-13 22:57:38 +0800
committerruki <[email protected]>2024-09-13 22:57:38 +0800
commit4fe5a495a81ebb3c7f032dfb9fd7f92298f41510 (patch)
tree93999df850b546fc0c1e49e02037cfd5232c8952
parent58d92b1928f19755ef3f8695bb79609f94764241 (diff)
add xmake bundle binary
-rw-r--r--.github/workflows/cosmocc.yml53
-rw-r--r--.github/workflows/macos.yml18
-rw-r--r--.github/workflows/macos_arm64.yml25
-rw-r--r--.github/workflows/windows.yml23
4 files changed, 65 insertions, 54 deletions
diff --git a/.github/workflows/cosmocc.yml b/.github/workflows/cosmocc.yml
deleted file mode 100644
index 3c7ed2f9e..000000000
--- a/.github/workflows/cosmocc.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-name: Cosmocc (x86_64)
-
-on:
- pull_request:
- push:
- release:
- types: [published]
-
-jobs:
- build:
-
- strategy:
- matrix:
- os: [macos-12]
- 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
-
- - name: Installation
- run: |
- brew install dmd
- brew install dub
-
- - name: Build
- run: |
- cd core
- xmake f --embed=y -y -cvD
- xmake -v
- cd ..
-
- - name: Tests
- run: |
- ls -l core/build/
- core/build/xmake --version
- core/build/xmake lua -v -D tests/run.lua
-
- - uses: actions/upload-artifact@v4
- with:
- name: xmake
- path: core/build/xmake
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 6eefc3a16..a75325b2c 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -48,6 +48,9 @@ jobs:
brew install gnu-tar
cd core
xmake pack -y --autobuild=n --basename=xmake -o ../artifacts xmakesrc
+ xmake f --embed=y -c
+ xmake
+ cp build/xmake ../artifacts/xmake-bundle
cd ..
- uses: actions/upload-artifact@v4
with:
@@ -61,6 +64,10 @@ jobs:
with:
name: xmake-latest.zip
path: artifacts/xmake.zip
+ - uses: actions/upload-artifact@v4
+ with:
+ name: xmake-bundle.macos.x86_64
+ path: artifact/xmake-bundle
# upload artifacts to latest release
- name: Get Previous tag
@@ -119,3 +126,14 @@ jobs:
asset_path: artifacts/xmake.zip
asset_name: xmake-${{ steps.tagName.outputs.tag }}.zip
asset_content_type: application/zip
+
+ - name: Publish bundle binary
+ if: github.event.action == 'published'
+ uses: actions/[email protected]
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: artifacts/xmake-bundle
+ asset_name: xmake-bundle-${{ steps.tagName.outputs.tag }}.macos.x86_64
+ asset_content_type: application/zip
diff --git a/.github/workflows/macos_arm64.yml b/.github/workflows/macos_arm64.yml
index 1e3ec4932..81c0aad7c 100644
--- a/.github/workflows/macos_arm64.yml
+++ b/.github/workflows/macos_arm64.yml
@@ -22,6 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
+ # WyriHaximus/github-action-get-previous-tag@master need it
fetch-depth: 0
submodules: true
- name: Prepare local xmake
@@ -29,9 +30,33 @@ jobs:
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: local#../xmake-source
+ - uses: little-core-labs/[email protected]
+ id: tagName
- name: Tests
run: |
xmake lua -v -D tests/run.lua
xrepo --version
+ - name: Artifact
+ run: |
+ cd core
+ xmake f --embed=y -c
+ xmake
+ cp build/xmake ../artifacts/xmake-bundle
+ cd ..
+ - uses: actions/upload-artifact@v4
+ with:
+ name: xmake-bundle.macos.arm64
+ path: artifact/xmake-bundle
+
+ - name: Publish bundle binary
+ if: github.event.action == 'published'
+ uses: actions/[email protected]
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: artifacts/xmake-bundle
+ asset_name: xmake-bundle-${{ steps.tagName.outputs.tag }}.macos.arm64
+ asset_content_type: application/zip
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index 5eee883c1..bca0db4f5 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -57,7 +57,10 @@ jobs:
- name: Build
run: |
cd core
- xmake f -vD -a ${{ matrix.arch }}
+ xmake f -vD -a ${{ matrix.arch }} --embed=y -c
+ xmake
+ cp build/xmake.exe ../artifacts/${{env.RELEASE_NAME}}/xmake-bundle.exe
+ xmake f -vD -a ${{ matrix.arch }} -c
xmake -vD
cd ..
@@ -104,6 +107,13 @@ jobs:
name: xmake-latest.${{ env.RELEASE_NAME }}.sha256
path: artifacts/${{env.RELEASE_NAME}}/shafile
+ - name: Upload artifacts (bundle)
+ if: matrix.os == 'windows-2022'
+ uses: actions/upload-artifact@v4
+ with:
+ name: xmake-bundle-latest.${{env.RELEASE_NAME}}.exe
+ path: artifacts/${{env.RELEASE_NAME}}/xmake-bundle.exe
+
# upload artifacts to latest release
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
@@ -166,3 +176,14 @@ jobs:
asset_name: xmake-${{ steps.tagName.outputs.tag }}.${{ env.RELEASE_NAME }}.sha256
asset_content_type: application/zip
+ - name: Publish
+ if: github.event.action == 'published' && matrix.os == 'windows-2022'
+ uses: actions/[email protected]
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: artifacts/${{env.RELEASE_NAME}}/xmake-bundle.exe
+ asset_name: xmake-bundle-${{ steps.tagName.outputs.tag }}.${{ env.RELEASE_NAME }}.exe
+ asset_content_type: application/zip
+