ci: Use target as matrix instead of OS

This commit is contained in:
Matan Kushner 2019-10-04 21:47:09 +09:00
parent cda01deffa
commit e90a3768da
No known key found for this signature in database
GPG Key ID: 4B98C3A8949CA8A4
1 changed files with 14 additions and 16 deletions

View File

@ -154,26 +154,24 @@ jobs:
github_release: github_release:
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
name: Create GitHub release [${{ matrix.target }}] name: Create GitHub release
needs: [test, docker_test] needs: [test, docker_test]
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
# In order to use different target names on parallel ubuntu builds, target:
# we use `ubuntu-latest` and `ubuntu-18.04` to include them separately - x86_64-unknown-linux-gnu
os: [ubuntu-latest, ubuntu-18.04, macOS-latest] - x86_64-unknown-linux-musl
- x86_64-apple-darwin
include: include:
- os: ubuntu-latest - target: x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-gnu os: ubuntu-latest
bin: starship
name: starship-x86_64-unknown-linux-gnu.tar.gz name: starship-x86_64-unknown-linux-gnu.tar.gz
- os: ubuntu-18.04 - target: x86_64-unknown-linux-musl
target: x86_64-unknown-linux-musl os: ubuntu-latest
bin: starship
name: starship-x86_64-unknown-linux-musl.tar.gz name: starship-x86_64-unknown-linux-musl.tar.gz
- os: macOS-latest - target: x86_64-apple-darwin
target: x86_64-apple-darwin os: macOS-latest
bin: starship
name: starship-x86_64-apple-darwin.tar.gz name: starship-x86_64-apple-darwin.tar.gz
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
@ -198,13 +196,13 @@ jobs:
- name: Prepare build artifacts - name: Prepare build artifacts
run: | run: |
strip target/${{ matrix.target }}/release/${{ matrix.bin }} strip target/${{ matrix.target }}/release/starship
cd target/${{ matrix.target }}/release cd target/${{ matrix.target }}/release
if [[ "${{ matrix.os }}" == "windows-latest" ]] if [[ "${{ matrix.os }}" == "windows-latest" ]]
then then
7z a ../../../${{ matrix.name }} ${{ matrix.bin }} 7z a ../../../${{ matrix.name }} starship
else else
tar czvf ../../../${{ matrix.name }} ${{ matrix.bin }} tar czvf ../../../${{ matrix.name }} starship
fi fi
cd - cd -