Update CI
* add `workflow_dispatch` for manual running * add `fail-fast` false in matrix * specify `persist-credentials: false` for actions/checkout * update actions to the latest versions * move cache before installing the toolchain * cache more stuff * limit deploy to shssoichiro/oxipng repository * reindent
This commit is contained in:
parent
110eae7c19
commit
e2836b914e
2 changed files with 108 additions and 95 deletions
32
.github/workflows/deploy.yml
vendored
32
.github/workflows/deploy.yml
vendored
|
|
@ -6,8 +6,9 @@ on:
|
|||
- 'v*.*.*'
|
||||
|
||||
jobs:
|
||||
|
||||
create-windows-binaries:
|
||||
runs-on: windows-latest
|
||||
if: github.repository == 'shssoichiro/oxipng'
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -16,10 +17,10 @@ jobs:
|
|||
# and I don't have a Windows machine set up to experiment with fixing it.
|
||||
# conf: [x86_64, i686]
|
||||
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
|
|
@ -55,12 +56,14 @@ jobs:
|
|||
echo "::set-output name=name::${ARCHIVE_NAME}.zip"
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ steps.package.outputs.name }}
|
||||
path: ${{ steps.package.outputs.file }}
|
||||
|
||||
create-unix-binaries:
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: github.repository == 'shssoichiro/oxipng'
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -71,10 +74,10 @@ jobs:
|
|||
- os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
|
|
@ -118,20 +121,21 @@ jobs:
|
|||
echo ::set-output "name=name::${ARCHIVE_NAME}.tar.gz"
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ steps.package.outputs.name }}
|
||||
path: ${{ steps.package.outputs.file }}
|
||||
|
||||
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'shssoichiro/oxipng'
|
||||
needs: [create-windows-binaries, create-unix-binaries]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Get version and release description
|
||||
id: tagName
|
||||
|
|
@ -141,7 +145,7 @@ jobs:
|
|||
echo "::set-output name=tag::$VERSION"
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: ./binaries
|
||||
|
||||
|
|
|
|||
27
.github/workflows/oxipng.yml
vendored
27
.github/workflows/oxipng.yml
vendored
|
|
@ -7,10 +7,13 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
|
|
@ -45,12 +48,25 @@ jobs:
|
|||
toolchain: beta
|
||||
- target: x86_64-unknown-linux-musl
|
||||
toolchain: nightly
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install musl tools
|
||||
run: sudo apt-get install musl-tools
|
||||
if: "contains(matrix.target, 'musl')"
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ matrix.toolchain }}-cargo-registry-
|
||||
- name: Install ${{ matrix.toolchain }}
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
|
|
@ -58,13 +74,6 @@ jobs:
|
|||
toolchain: ${{ matrix.toolchain }}
|
||||
override: true
|
||||
components: clippy, rustfmt
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cargo/registry/cache
|
||||
key: ${{ matrix.target }}-${{ matrix.toolchain }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ matrix.target }}-${{ matrix.toolchain }}-cargo-registry-
|
||||
- name: Run rustfmt
|
||||
if: matrix.toolchain == 'stable'
|
||||
uses: actions-rs/cargo@v1
|
||||
|
|
|
|||
Loading…
Reference in a new issue