Skip to content

Commit cd0eb0d

Browse files
authored
Merge pull request #5612 from xmake-io/bundle
add xmake bundle binary
2 parents 58d92b1 + 8b926a9 commit cd0eb0d

File tree

4 files changed

+66
-54
lines changed

4 files changed

+66
-54
lines changed

.github/workflows/cosmocc.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/macos.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
brew install gnu-tar
4949
cd core
5050
xmake pack -y --autobuild=n --basename=xmake -o ../artifacts xmakesrc
51+
xmake f --embed=y -c
52+
xmake
53+
cp build/xmake ../artifacts/xmake-bundle
5154
cd ..
5255
- uses: actions/upload-artifact@v4
5356
with:
@@ -61,6 +64,10 @@ jobs:
6164
with:
6265
name: xmake-latest.zip
6366
path: artifacts/xmake.zip
67+
- uses: actions/upload-artifact@v4
68+
with:
69+
name: xmake-bundle.macos.x86_64
70+
path: artifacts/xmake-bundle
6471

6572
# upload artifacts to latest release
6673
- name: Get Previous tag
@@ -119,3 +126,14 @@ jobs:
119126
asset_path: artifacts/xmake.zip
120127
asset_name: xmake-${{ steps.tagName.outputs.tag }}.zip
121128
asset_content_type: application/zip
129+
130+
- name: Publish bundle binary
131+
if: github.event.action == 'published'
132+
uses: actions/upload-release-asset@v1.0.1
133+
env:
134+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135+
with:
136+
upload_url: ${{ github.event.release.upload_url }}
137+
asset_path: artifacts/xmake-bundle
138+
asset_name: xmake-bundle-${{ steps.tagName.outputs.tag }}.macos.x86_64
139+
asset_content_type: application/zip

.github/workflows/macos_arm64.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,42 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v2
2424
with:
25+
# WyriHaximus/github-action-get-previous-tag@master need it
2526
fetch-depth: 0
2627
submodules: true
2728
- name: Prepare local xmake
2829
run: cp -rf . ../xmake-source
2930
- uses: xmake-io/github-action-setup-xmake@v1
3031
with:
3132
xmake-version: local#../xmake-source
33+
- uses: little-core-labs/get-git-tag@v3.0.2
34+
id: tagName
3235

3336
- name: Tests
3437
run: |
3538
xmake lua -v -D tests/run.lua
3639
xrepo --version
3740
41+
- name: Artifact
42+
run: |
43+
cd core
44+
xmake f --embed=y -c
45+
xmake
46+
mkdir ../artifacts
47+
cp build/xmake ../artifacts/xmake-bundle
48+
cd ..
49+
- uses: actions/upload-artifact@v4
50+
with:
51+
name: xmake-bundle.macos.arm64
52+
path: artifacts/xmake-bundle
53+
54+
- name: Publish bundle binary
55+
if: github.event.action == 'published'
56+
uses: actions/upload-release-asset@v1.0.1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ github.event.release.upload_url }}
61+
asset_path: artifacts/xmake-bundle
62+
asset_name: xmake-bundle-${{ steps.tagName.outputs.tag }}.macos.arm64
63+
asset_content_type: application/zip

.github/workflows/windows.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ jobs:
5757
- name: Build
5858
run: |
5959
cd core
60-
xmake f -vD -a ${{ matrix.arch }}
60+
xmake f -vD -a ${{ matrix.arch }} --embed=y -c
61+
xmake
62+
xmake l os.cp build/xmake.exe ../artifacts/${{env.RELEASE_NAME}}/xmake-bundle.exe
63+
xmake f -vD -a ${{ matrix.arch }} -c
6164
xmake -vD
6265
cd ..
6366
@@ -104,6 +107,13 @@ jobs:
104107
name: xmake-latest.${{ env.RELEASE_NAME }}.sha256
105108
path: artifacts/${{env.RELEASE_NAME}}/shafile
106109

110+
- name: Upload artifacts (bundle)
111+
if: matrix.os == 'windows-2022'
112+
uses: actions/upload-artifact@v4
113+
with:
114+
name: xmake-bundle-latest.${{env.RELEASE_NAME}}.exe
115+
path: artifacts/${{env.RELEASE_NAME}}/xmake-bundle.exe
116+
107117
# upload artifacts to latest release
108118
- name: Inject slug/short variables
109119
uses: rlespinasse/github-slug-action@v3.x
@@ -166,3 +176,14 @@ jobs:
166176
asset_name: xmake-${{ steps.tagName.outputs.tag }}.${{ env.RELEASE_NAME }}.sha256
167177
asset_content_type: application/zip
168178

179+
- name: Publish
180+
if: github.event.action == 'published' && matrix.os == 'windows-2022'
181+
uses: actions/upload-release-asset@v1.0.1
182+
env:
183+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
184+
with:
185+
upload_url: ${{ github.event.release.upload_url }}
186+
asset_path: artifacts/${{env.RELEASE_NAME}}/xmake-bundle.exe
187+
asset_name: xmake-bundle-${{ steps.tagName.outputs.tag }}.${{ env.RELEASE_NAME }}.exe
188+
asset_content_type: application/zip
189+

0 commit comments

Comments
 (0)