12 build: [linux, macos, windows-gnu, windows-msvc]
22 rust: nightly-x86_64-gnu
25 rust: nightly-x86_64-msvc
26 runs-on: ${{ matrix.os }}
28 - uses: actions/checkout@v2
31 uses: actions-rs/toolchain@v1
34 toolchain: ${{ matrix.rust }}
37 - name: Install cargo-make
38 uses: actions-rs/cargo@v1
41 args: --force cargo-make
43 - name: Build release binaries
44 uses: actions-rs/cargo@v1
52 staging="rustfmt_${{ matrix.build }}_${{ github.event.release.tag_name }}"
55 cp {README.md,Configurations.md,CHANGELOG.md,LICENSE-MIT,LICENSE-APACHE} "$staging/"
57 if [ "${{ matrix.os }}" = "windows-latest" ]; then
58 cp target/release/{rustfmt.exe,cargo-fmt.exe,rustfmt-format-diff.exe,git-rustfmt.exe} "$staging/"
59 7z a "$staging.zip" "$staging"
60 echo "ASSET=$staging.zip" >> $GITHUB_ENV
62 cp target/release/{rustfmt,cargo-fmt,rustfmt-format-diff,git-rustfmt} "$staging/"
63 tar czf "$staging.tar.gz" "$staging"
64 echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
67 - name: Upload Release Asset
68 uses: actions/upload-release-asset@v1
70 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72 upload_url: ${{ github.event.release.upload_url }}
73 asset_path: ${{ env.ASSET }}
74 asset_name: ${{ env.ASSET }}
75 asset_content_type: application/octet-stream