From c2c67e16220e39cc1c0ae3a767b76491ef807db2 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 14 Mar 2024 23:50:15 +0800 Subject: fix macos yml --- .github/workflows/macos.yml | 121 +++++++++++++++++++++++++++++++++++++ .github/workflows/macos_x86_64.yml | 121 ------------------------------------- 2 files changed, 121 insertions(+), 121 deletions(-) create mode 100644 .github/workflows/macos.yml delete mode 100644 .github/workflows/macos_x86_64.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 000000000..b2abd0f88 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,121 @@ +name: macOS (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 }}-macOS-${{ matrix.arch }} + cancel-in-progress: true + 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/get-git-tag@v3.0.2 + id: tagName + + - name: Installation + run: | + brew install dmd + brew install dub + + - name: Tests + run: | + xmake lua -v -D tests/run.lua + xrepo --version + + - name: Artifact + run: | + brew install gnu-tar + cd core + xmake pack -y --autobuild=n --basename=xmake -o ../artifacts xmakesrc + cd .. + - uses: actions/upload-artifact@v2 + with: + name: xmake-latest.gz.run + path: artifacts/xmake.gz.run + - uses: actions/upload-artifact@v2 + with: + name: xmake-latest.tar.gz + path: artifacts/xmake.tar.gz + - uses: actions/upload-artifact@v2 + with: + name: xmake-latest.zip + path: artifacts/xmake.zip + + # upload artifacts to latest release + - name: Get Previous tag + id: previoustag + uses: WyriHaximus/github-action-get-previous-tag@master + + - name: Upload artifacts to lastest release + if: github.ref == 'refs/heads/master' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/xmake.zip + asset_name: xmake-master.zip + tag: ${{ steps.previoustag.outputs.tag }} + overwrite: true + + - name: Upload artifacts to lastest release + if: github.ref == 'refs/heads/master' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/xmake.tar.gz + asset_name: xmake-master.tar.gz + tag: ${{ steps.previoustag.outputs.tag }} + overwrite: true + + - name: Publish gz runfile + if: github.event.action == 'published' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: artifacts/xmake.gz.run + asset_name: xmake-${{ steps.tagName.outputs.tag }}.gz.run + asset_content_type: application/zip + + - name: Publish gz archive + if: github.event.action == 'published' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: artifacts/xmake.tar.gz + asset_name: xmake-${{ steps.tagName.outputs.tag }}.tar.gz + asset_content_type: application/zip + + - name: Publish zip archive + if: github.event.action == 'published' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: artifacts/xmake.zip + asset_name: xmake-${{ steps.tagName.outputs.tag }}.zip + asset_content_type: application/zip diff --git a/.github/workflows/macos_x86_64.yml b/.github/workflows/macos_x86_64.yml deleted file mode 100644 index b2abd0f88..000000000 --- a/.github/workflows/macos_x86_64.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: macOS (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 }}-macOS-${{ matrix.arch }} - cancel-in-progress: true - 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/get-git-tag@v3.0.2 - id: tagName - - - name: Installation - run: | - brew install dmd - brew install dub - - - name: Tests - run: | - xmake lua -v -D tests/run.lua - xrepo --version - - - name: Artifact - run: | - brew install gnu-tar - cd core - xmake pack -y --autobuild=n --basename=xmake -o ../artifacts xmakesrc - cd .. - - uses: actions/upload-artifact@v2 - with: - name: xmake-latest.gz.run - path: artifacts/xmake.gz.run - - uses: actions/upload-artifact@v2 - with: - name: xmake-latest.tar.gz - path: artifacts/xmake.tar.gz - - uses: actions/upload-artifact@v2 - with: - name: xmake-latest.zip - path: artifacts/xmake.zip - - # upload artifacts to latest release - - name: Get Previous tag - id: previoustag - uses: WyriHaximus/github-action-get-previous-tag@master - - - name: Upload artifacts to lastest release - if: github.ref == 'refs/heads/master' - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/xmake.zip - asset_name: xmake-master.zip - tag: ${{ steps.previoustag.outputs.tag }} - overwrite: true - - - name: Upload artifacts to lastest release - if: github.ref == 'refs/heads/master' - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/xmake.tar.gz - asset_name: xmake-master.tar.gz - tag: ${{ steps.previoustag.outputs.tag }} - overwrite: true - - - name: Publish gz runfile - if: github.event.action == 'published' - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: artifacts/xmake.gz.run - asset_name: xmake-${{ steps.tagName.outputs.tag }}.gz.run - asset_content_type: application/zip - - - name: Publish gz archive - if: github.event.action == 'published' - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: artifacts/xmake.tar.gz - asset_name: xmake-${{ steps.tagName.outputs.tag }}.tar.gz - asset_content_type: application/zip - - - name: Publish zip archive - if: github.event.action == 'published' - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: artifacts/xmake.zip - asset_name: xmake-${{ steps.tagName.outputs.tag }}.zip - asset_content_type: application/zip -- cgit v1.3.1