diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b599e04..9a38e62 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,6 +104,49 @@ jobs: asset_name: linetest.exe asset_content_type: application/zip + + - name: Build Cli + working-directory: ./linetest-cli + run: cargo build --release + + - name: Upload Linux Cli + if: matrix.os == 'ubuntu-latest' + id: upload-release-asset-lin-cli + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.release_job.outputs.upload_url }} + asset_path: linetest-cli/target/release/linetest-cli + asset_name: linetest_cli_linux + asset_content_type: application/zip + + - name: Upload Mac Cli + if: matrix.os == 'macOS-latest' + id: upload-release-asset-mac-cli + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.release_job.outputs.upload_url }} + asset_path: linetest-cli/target/release/linetest-cli + asset_name: linetest_cli_mac + asset_content_type: application/zip + + - name: Upload Windows Cli + if: matrix.os == 'windows-latest' + id: upload-release-asset-windows-cli + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.release_job.outputs.upload_url }} + asset_path: linetest-cli/target/release/linetest-cli.exe + asset_name: linetest_cli.exe + asset_content_type: application/zip + + + publish_release: name: Publish release needs: [build_job, release_job] diff --git a/.github/workflows/release_cli.yml b/.github/workflows/release_cli.yml deleted file mode 100644 index f84cbfd..0000000 --- a/.github/workflows/release_cli.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: Release cli - -on: - push: - tags: - - "*" - -env: - CARGO_TERM_COLOR: always - -jobs: - release_job: - name: Create release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} - release_id: ${{ steps.create_release.outputs.id }} - steps: - - name: Create release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: true - - name: Write release id to file - run: echo "${{ steps.create_release.outputs.id }}" > release_id - - build_job: - name: Build release - needs: release_job - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] - rust: [nightly] - steps: - - uses: actions/checkout@v2 - - - name: Install xcb - run: sudo apt-get install libxcb-shape0-dev libxcb-xfixes0-dev libxext-dev libxkbcommon-dev - if: matrix.os == 'ubuntu-latest' - - - name: Build - working-directory: ./linetest-cli - run: cargo build --release - - - name: Upload Linux Release - if: matrix.os == 'ubuntu-latest' - id: upload-release-asset-lin - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.release_job.outputs.upload_url }} - asset_path: linetest-cli/target/release/linetest-cli - asset_name: linetest_cli_linux - asset_content_type: application/zip - - - name: Upload Mac Release - if: matrix.os == 'macOS-latest' - id: upload-release-asset-mac - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.release_job.outputs.upload_url }} - asset_path: linetest-cli/target/release/linetest-cli - asset_name: linetest_cli_mac - asset_content_type: application/zip - - - name: Upload Windows Release - if: matrix.os == 'windows-latest' - id: upload-release-asset-windows - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.release_job.outputs.upload_url }} - asset_path: linetest-cli/target/release/linetest-cli.exe - asset_name: linetest_cli.exe - asset_content_type: application/zip - - publish_release: - name: Publish release - needs: [build_job, release_job] - runs-on: ubuntu-latest - steps: - - name: Test id - run: echo "${{ needs.release_job.outputs.release_id }}" - - name: Test id 2 - run: echo "${{ needs.release_job.outputs.upload_url }}" - - name: Publish - uses: eregon/publish-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - release_id: ${{ needs.release_job.outputs.release_id }}