|
| 1 | +name: Build slack_cli |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - "slack_cli-v[0-9]+.[0-9]+.[0-9]+" |
| 8 | + |
| 9 | +jobs: |
| 10 | + build_slack_cli: |
| 11 | + defaults: |
| 12 | + run: |
| 13 | + working-directory: slack_cli |
| 14 | + name: Build slack_cli |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + os: [ubuntu-latest, windows-latest, macos-latest, macos-13] |
| 18 | + include: |
| 19 | + - binary-name: slack_cli_linux |
| 20 | + os: ubuntu-latest |
| 21 | + - binary-name: slack_cli.exe |
| 22 | + os: windows-latest |
| 23 | + - binary-name: slack_cli_macos |
| 24 | + os: macos-latest |
| 25 | + - binary-name: slack_cli_macos_x86 |
| 26 | + os: macos-13 |
| 27 | + runs-on: ${{ matrix.os }} |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - uses: dart-lang/setup-dart@v1 |
| 31 | + - run: dart pub get |
| 32 | + - run: mkdir build |
| 33 | + - run: mkdir build/${{ matrix.os }} |
| 34 | + - run: dart compile exe bin/slack_cli.dart -o build/${{ matrix.os }}/${{ matrix.binary-name }} |
| 35 | + - uses: actions/upload-artifact@v4 |
| 36 | + with: |
| 37 | + name: bin-${{ matrix.os }} |
| 38 | + path: slack_cli/build/${{ matrix.os }}/${{ matrix.binary-name }} |
| 39 | + |
| 40 | + upload_artifacts: |
| 41 | + needs: build_slack_cli |
| 42 | + name: Upload Artifacts to GitHub Release |
| 43 | + runs-on: ubuntu-latest |
| 44 | + permissions: |
| 45 | + contents: write |
| 46 | + steps: |
| 47 | + - uses: actions/download-artifact@v4 |
| 48 | + with: |
| 49 | + name: bin-ubuntu-latest |
| 50 | + path: bin-linux |
| 51 | + - uses: actions/download-artifact@v4 |
| 52 | + with: |
| 53 | + name: bin-macos-latest |
| 54 | + path: bin-macos |
| 55 | + - uses: actions/download-artifact@v4 |
| 56 | + with: |
| 57 | + name: bin-windows-latest |
| 58 | + path: bin-windows |
| 59 | + - uses: actions/download-artifact@v4 |
| 60 | + with: |
| 61 | + name: bin-macos-13 |
| 62 | + path: bin-macos-x86 |
| 63 | + |
| 64 | + - name: Upload artifacts to existing release |
| 65 | + uses: softprops/action-gh-release@v1 |
| 66 | + with: |
| 67 | + files: bin-*/* |
| 68 | + draft: false # Publish the release after artifacts are uploaded |
0 commit comments