From bdb9eb7d894df28af663a16741933021b5f1f42c Mon Sep 17 00:00:00 2001 From: Samyak Jain <56000318+samyakkkk@users.noreply.github.com> Date: Mon, 27 May 2024 17:21:08 +0530 Subject: [PATCH] Update executables.yml --- .github/workflows/executables.yml | 120 +++++++++++++++--------------- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/.github/workflows/executables.yml b/.github/workflows/executables.yml index 1bc8a88..ac55fb6 100644 --- a/.github/workflows/executables.yml +++ b/.github/workflows/executables.yml @@ -1,113 +1,115 @@ name: Build, Test and Verify Executables on: - push: + push: branches: - - build/executables + - build/executables +##TODO: In future, when m1 runners are publicly supported, compiled and verify seperately for arm architectures. jobs: - build: + build: runs-on: ${{ matrix.os }} strategy: - matrix: + matrix: os: [ubuntu-latest, windows-latest, macOS-latest, macos-13] include: - - os: ubuntu-latest + - os: ubuntu-latest output-name: commanddash-linux - - os: macOS-latest + - os: macOS-latest output-name: commanddash-mac - - os: windows-latest + - os: windows-latest output-name: commanddash-windows.exe - - os: macos-13 - output-name: commanddash-mac-x64 + - os: macos-13 + binary-name: commanddash-mac-x64 steps: - - uses: actions/checkout@v4 - - uses: dart-lang/setup-dart@v1 - - name: Dart pub get + - uses: actions/checkout@v4 + - uses: dart-lang/setup-dart@v1 + - name: Dart pub get run: | - cd commanddash - mkdir -p build - dart pub get - - name: Compile + cd commanddash + mkdir -p build + dart pub get + - name: Compile run: | - cd commanddash - dart compile exe bin/commanddash.dart -o build/${{ matrix.output-name }} - - uses: actions/upload-artifact@v4 + cd commanddash + dart compile exe bin/commanddash.dart -o build/${{ matrix.output-name }} + - uses: actions/upload-artifact@v4 with: - name: ${{ matrix.output-name }} # Dynamically name the artifact based on the OS - path: commanddash/build/${{ matrix.output-name }} - - test: + name: ${{ matrix.output-name }} # Dynamically name the artifact based on the OS + path: commanddash/build/${{ matrix.output-name }} + + test: needs: build runs-on: ${{ matrix.os }} - + strategy: - matrix: + matrix: include: - - os: ubuntu-latest + - os: ubuntu-latest binary-name: commanddash-linux - - os: windows-latest + - os: windows-latest binary-name: commanddash-windows.exe - - os: macos-latest + - os: macos-latest binary-name: commanddash-mac - - os: macos-13 + - os: macos-13 binary-name: commanddash-mac-x64 - + steps: - - uses: actions/checkout@v4 - - - uses: actions/download-artifact@v4 + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 with: - name: ${{ matrix.binary-name }} - path: ./executable - - # Ensure binary is executable (necessary for Unix-based systems) - - name: Make binary executable + name: ${{ matrix.binary-name }} + path: ./executable + + # Ensure binary is executable (necessary for Unix-based systems) + - name: Make binary executable if: matrix.os != 'windows-latest' run: chmod +x ./executable/${{ matrix.binary-name }} - - name: Test binary + - name: Test binary run: ./executable/${{ matrix.binary-name }} --help - submit-executables: + submit-executables: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: name: commanddash-linux path: ./executable - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: name: commanddash-mac path: ./executable - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: name: commanddash-windows.exe path: ./executable - - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: name: commanddash-mac-x64 path: ./executable - - name: Submit Executables + - name: Submit Executables run: | - chmod +x ./executable/commanddash-linux - echo "Version: $(./executable/commanddash-linux version)" - echo "Minimum client version: $(./executable/commanddash-linux min_client_version)" - curl -X POST "https://api.commanddash.dev/executable/add" \ - -H "Content-Type: multipart/form-data" \ - -F "secret=${{ secrets.SECRET_KEY }}" \ - -F "version=$(./executable/commanddash-linux version)" \ - -F "minimum_client_version=$(./executable/commanddash-linux min_client_version)" \ - -F "windows_binary=@executable/commanddash-windows.exe" \ - -F "macos_binary=@executable/commanddash-mac" \ - -F "linux_binary=@executable/commanddash-linux" \ - -F "macos_x64_binary=@executable/commanddash-mac-x64" \ No newline at end of file + chmod +x ./executable/commanddash-linux + echo "Version: $(./executable/commanddash-linux version)" + echo "Minimum client version: $(./executable/commanddash-linux min_client_version)" + curl -X POST "https://api.commanddash.dev/executable/add" \ + -H "Content-Type: multipart/form-data" \ + -F "secret=${{ secrets.SECRET_KEY }}" \ + -F "version=$(./executable/commanddash-linux version)" \ + -F "minimum_client_version=$(./executable/commanddash-linux min_client_version)" \ + -F "windows_binary=@executable/commanddash-windows.exe" \ + -F "macos_binary=@executable/commanddash-mac" \ + -F "linux_binary=@executable/commanddash-linux" + -F "macos_x64_binary=@executable/commanddash-mac-x64" + +