name: Build on: push: branches: [ "master" ] tags: - 'v*' pull_request: branches: [ "master" ] env: CARGO_TERM_COLOR: always CARGO_TERM_PROGRESS_WHEN: never jobs: build: strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: awalsh128/cache-apt-pkgs-action@v1.3.0 if: runner.os == 'Linux' with: packages: libudev-dev version: 1.0 - uses: Swatinem/rust-cache@v2.3.0 - name: Build run: cargo build --release --bin kubi --bin kubi-server - name: Create artifact shell: bash run: | mkdir artifact; cp ./target/release/kubi ./artifact; cp ./target/release/kubi-server ./artifact; cp -r ./assets ./artifact; cp ./Server.toml ./artifact; - uses: actions/upload-artifact@v3 with: name: ${{ runner.os }}_${{ runner.arch }} path: ./artifact/* if-no-files-found: error publish-release: needs: build if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v2 with: path: ./artifacts - uses: rlespinasse/github-slug-action@v4.4.1 - uses: ncipollo/release-action@v1 with: tag: ${{ env.GITHUB_REF_SLUG_URL }} makeLatest: true artifacts: ./artifacts/*