name: CD Win/MacOS Native on: workflow_dispatch: release: types: [ created ] jobs: - x86_64_win_macos_linux: name: "x86_64 default Pipeline" strategy: fail-fast: false matrix: platform: [ macos-latest, windows-latest, ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable profile: minimal override: true components: rustfmt, clippy - uses: actions-rs/cargo@v1.0.1 name: Run tests with: command: test - uses: actions-rs/cargo@v1.0.1 name: Build with: command: build args: --release --all-features - name: Rename Release (Unix) run: | cargo install default-target mkdir assets FILENAME=topgrade-${{github.event.release.tag_name}}-$(default-target) mv target/release/topgrade assets cd assets tar --format=ustar -czf $FILENAME.tar.gz topgrade rm topgrade ls . if: ${{ matrix.platform != 'windows-latest' }} shell: bash - name: Rename Release (Windows) run: | cargo install default-target mkdir assets FILENAME=topgrade-${{github.event.release.tag_name}}-$(default-target) mv target/release/topgrade.exe assets/topgrade.exe cd assets powershell Compress-Archive -Path * -Destination ${FILENAME}.zip rm topgrade.exe ls . if: ${{ matrix.platform == 'windows-latest' }} shell: bash - name: Release uses: softprops/action-gh-release@v1 with: files: assets/* - x86_64_freebsd: name: "FreeBSD x86_64" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable target: x86_64-unknown-freebsd override: true - uses: actions-rs/cargo@v1 name: Build with: use-cross: true command: build args: --target x86_64-unknown-freebsd --release --all-features - run: | cargo install default-target mkdir assets FILENAME=topgrade-${{github.event.release.tag_name}}-$(x86_64-unknown-freebsd) mv target/release/topgrade assets cd assets tar --format=ustar -czf $FILENAME.tar.gz topgrade rm topgrade ls . shell: bash - name: Release uses: softprops/action-gh-release@v1 with: files: assets/* x86_64_linux_musl: name: "Linux Musl x86_64" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable target: x86_64-unknown-linux-musl override: true - uses: actions-rs/cargo@v1 name: Build with: use-cross: true command: build args: --target x86_64-unknown-linux-musl --release --all-features - run: | cargo install default-target mkdir assets FILENAME=topgrade-${{github.event.release.tag_name}}-$(x86_64-unknown-linux-musl) mv target/release/topgrade assets cd assets tar --format=ustar -czf $FILENAME.tar.gz topgrade rm topgrade ls . shell: bash - name: Release uses: softprops/action-gh-release@v1 with: files: assets/* - aarch64_linux_gnu: name: "Linux GNU aarch64" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable target: aarch64-unknown-linux-gnu override: true - uses: actions-rs/cargo@v1 name: Build with: use-cross: true command: build args: --target aarch64-unknown-linux-gnu --release --all-features - run: | cargo install default-target mkdir assets FILENAME=topgrade-${{github.event.release.tag_name}}-$(aarch64-unknown-linux-gnu) mv target/release/topgrade assets cd assets tar --format=ustar -czf $FILENAME.tar.gz topgrade rm topgrade ls . shell: bash - name: Release uses: softprops/action-gh-release@v1 with: files: assets/* - aarch64_linux_musl: name: "Linux Musl aarch64" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable target: aarch64-unknown-linux-musl override: true - uses: actions-rs/cargo@v1 name: Build with: use-cross: true command: build args: --target aarch64-unknown-linux-musl --release --all-features - run: | cargo install default-target mkdir assets FILENAME=topgrade-${{github.event.release.tag_name}}-$(aarch64-unknown-linux-musl) mv target/release/topgrade assets cd assets tar --format=ustar -czf $FILENAME.tar.gz topgrade rm topgrade ls . shell: bash - name: Release uses: softprops/action-gh-release@v1 with: files: assets/*