1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-01 09:13:54 +00:00

ci: Fix windows-msvc build failure

Split Windows and -nix asset preparation steps
This commit is contained in:
Matan Kushner 2019-10-20 23:19:40 +09:00
parent 2461b84ed9
commit fbb4b59ca9
No known key found for this signature in database
GPG Key ID: 4B98C3A8949CA8A4

View File

@ -18,7 +18,9 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
profile: minimal
toolchain: stable toolchain: stable
components: rustfmt
override: true override: true
- run: rustup component add rustfmt - run: rustup component add rustfmt
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
@ -34,9 +36,10 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
profile: minimal
toolchain: stable toolchain: stable
components: clippy
override: true override: true
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1 - uses: actions-rs/clippy-check@v1
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@ -66,6 +69,7 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
profile: minimal
toolchain: stable toolchain: stable
override: true override: true
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
@ -91,6 +95,7 @@ jobs:
# Install all the required dependencies for testing # Install all the required dependencies for testing
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
profile: minimal
toolchain: stable toolchain: stable
override: true override: true
@ -154,6 +159,7 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
profile: minimal
toolchain: stable toolchain: stable
override: true override: true
- run: cargo login $CRATES_IO_TOKEN - run: cargo login $CRATES_IO_TOKEN
@ -170,9 +176,9 @@ jobs:
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- run: | - run: |
git config --global user.name starship-bot git config user.email "bot@starship.rs"
git config --global user.email bot@starship.rs git config user.name "Starship Bot"
- run: |
cd $(brew --repo homebrew/core) cd $(brew --repo homebrew/core)
git fetch origin git fetch origin
sudo git reset --hard origin/master sudo git reset --hard origin/master
@ -218,6 +224,7 @@ jobs:
- name: Install Rust toolchain - name: Install Rust toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal
toolchain: stable toolchain: stable
override: true override: true
target: ${{ matrix.target }} target: ${{ matrix.target }}
@ -232,21 +239,20 @@ jobs:
command: build command: build
args: --release --target ${{ matrix.target }} args: --release --target ${{ matrix.target }}
- name: Prepare build artifacts - name: Prepare build artifacts [Windows]
if: matrix.os == 'windows-latest'
run: | run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]] strip target/${{ matrix.target }}/release/starship.exe
then 7z a ${{ matrix.name }} target/${{ matrix.target }}/release/starship.exe
strip target/${{ matrix.target }}/release/starship.exe
cd target/${{ matrix.target }}/release - name: Prepare build artifacts [-nix]
7z a ../../../${{ matrix.name }} starship.exe if: matrix.os != 'windows-latest'
else run: |
strip target/${{ matrix.target }}/release/starship strip target/${{ matrix.target }}/release/starship
cd target/${{ matrix.target }}/release tar czvf ${{ matrix.name }} target/${{ matrix.target }}/release/starship
tar czvf ../../../${{ matrix.name }} starship
fi
cd -
- name: Generate release notes - name: Generate release notes
if: matrix.os == 'ubuntu-latest'
run: | run: |
# Temporary fix for https://github.com/actions/setup-go/issues/14 # Temporary fix for https://github.com/actions/setup-go/issues/14
export PATH=$PATH:$(go env GOPATH)/bin export PATH=$PATH:$(go env GOPATH)/bin