Skip to content

Commit

Permalink
add xmake bundle binary
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Sep 13, 2024
1 parent 58d92b1 commit 4fe5a49
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 54 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/cosmocc.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
25 changes: 25 additions & 0 deletions .github/workflows/macos_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,41 @@ 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
run: cp -rf . ../xmake-source
- 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
23 changes: 22 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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

0 comments on commit 4fe5a49

Please sign in to comment.