summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-09-13 14:04:19 +0800
committerGitHub <[email protected]>2024-09-13 14:04:19 +0800
commitcd0eb0da726f66fe3137e992db79c5a7d059c26c (patch)
tree941d5b7b752d9b8aa085f6a54e9b856ad67a3003
parent58d92b1928f19755ef3f8695bb79609f94764241 (diff)
parent8b926a954a28d87acb4df49d4bd853e9d030c6f1 (diff)
Merge pull request #5612 from xmake-io/bundle
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.yml26
-rw-r--r--.github/workflows/windows.yml23
4 files changed, 66 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..f6129fbfd 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: artifacts/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..de909462d 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,34 @@ 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
+ mkdir ../artifacts
+ cp build/xmake ../artifacts/xmake-bundle
+ cd ..
+ - uses: actions/upload-artifact@v4
+ with:
+ name: xmake-bundle.macos.arm64
+ path: artifacts/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..0d2a32855 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
+ xmake l os.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
+