12 build: [linux-x86_64, macos-x86_64, windows-x86_64-gnu, windows-x86_64-msvc]
20 - build: windows-x86_64-gnu
22 rust: nightly-x86_64-gnu
23 - build: windows-x86_64-msvc
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: Add mingw64 to path for x86_64-gnu
38 run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
39 if: matrix.rust == 'nightly-x86_64-gnu'
42 - name: Install cargo-make
43 uses: actions-rs/cargo@v1
46 args: --force cargo-make
48 - name: Build release binaries
49 uses: actions-rs/cargo@v1
57 staging="rustfmt_${{ matrix.build }}_${{ github.event.release.tag_name }}"
60 cp {README.md,Configurations.md,CHANGELOG.md,LICENSE-MIT,LICENSE-APACHE} "$staging/"
62 if [ "${{ matrix.os }}" = "windows-latest" ]; then
63 cp target/release/{rustfmt.exe,cargo-fmt.exe,rustfmt-format-diff.exe,git-rustfmt.exe} "$staging/"
64 7z a "$staging.zip" "$staging"
65 echo "ASSET=$staging.zip" >> $GITHUB_ENV
67 cp target/release/{rustfmt,cargo-fmt,rustfmt-format-diff,git-rustfmt} "$staging/"
68 tar czf "$staging.tar.gz" "$staging"
69 echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
72 - name: Upload Release Asset
73 uses: actions/upload-release-asset@v1
75 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77 upload_url: ${{ github.event.release.upload_url }}
78 asset_path: ${{ env.ASSET }}
79 asset_name: ${{ env.ASSET }}
80 asset_content_type: application/octet-stream