From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../rustfmt/.github/workflows/upload-assets.yml | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/tools/rustfmt/.github/workflows/upload-assets.yml (limited to 'src/tools/rustfmt/.github/workflows/upload-assets.yml') diff --git a/src/tools/rustfmt/.github/workflows/upload-assets.yml b/src/tools/rustfmt/.github/workflows/upload-assets.yml new file mode 100644 index 000000000..25699234a --- /dev/null +++ b/src/tools/rustfmt/.github/workflows/upload-assets.yml @@ -0,0 +1,81 @@ +name: upload + +on: + push: + release: + types: [created] + workflow_dispatch: + +jobs: + build-release: + name: build-release + strategy: + matrix: + build: [linux-x86_64, macos-x86_64, windows-x86_64-gnu, windows-x86_64-msvc] + include: + - build: linux-x86_64 + os: ubuntu-latest + rust: nightly + target: x86_64-unknown-linux-gnu + - build: macos-x86_64 + os: macos-latest + rust: nightly + target: x86_64-apple-darwin + - build: windows-x86_64-gnu + os: windows-latest + rust: nightly-x86_64-gnu + target: x86_64-pc-windows-gnu + - build: windows-x86_64-msvc + os: windows-latest + rust: nightly-x86_64-msvc + target: x86_64-pc-windows-msvc + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + + # Run build + - name: install rustup + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh + sh rustup-init.sh -y --default-toolchain none + rustup target add ${{ matrix.target }} + + - name: Add mingw64 to path for x86_64-gnu + run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH + if: matrix.rust == 'nightly-x86_64-gnu' + shell: bash + + - name: Build release binaries + uses: actions-rs/cargo@v1 + with: + command: build + args: --release + + - name: Build archive + shell: bash + run: | + staging="rustfmt_${{ matrix.build }}_${{ github.event.release.tag_name }}" + mkdir -p "$staging" + + cp {README.md,Configurations.md,CHANGELOG.md,LICENSE-MIT,LICENSE-APACHE} "$staging/" + + if [ "${{ matrix.os }}" = "windows-latest" ]; then + cp target/release/{rustfmt.exe,cargo-fmt.exe,rustfmt-format-diff.exe,git-rustfmt.exe} "$staging/" + 7z a "$staging.zip" "$staging" + echo "ASSET=$staging.zip" >> $GITHUB_ENV + else + cp target/release/{rustfmt,cargo-fmt,rustfmt-format-diff,git-rustfmt} "$staging/" + tar czf "$staging.tar.gz" "$staging" + echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV + fi + + - name: Upload Release Asset + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ env.ASSET }} + asset_name: ${{ env.ASSET }} + asset_content_type: application/octet-stream -- cgit v1.2.3