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
be19ed592d
commit
e88b9be12b
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*.*.*'
|
- 'v*.*.*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
create-windows-binaries:
|
create-windows-binaries:
|
||||||
|
runs-on: windows-latest
|
||||||
|
if: github.repository == 'shssoichiro/oxipng'
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -16,10 +17,10 @@ jobs:
|
||||||
# and I don't have a Windows machine set up to experiment with fixing it.
|
# and I don't have a Windows machine set up to experiment with fixing it.
|
||||||
# conf: [x86_64, i686]
|
# conf: [x86_64, i686]
|
||||||
|
|
||||||
runs-on: windows-latest
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install stable
|
- name: Install stable
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
|
@ -55,12 +56,14 @@ jobs:
|
||||||
echo "::set-output name=name::${ARCHIVE_NAME}.zip"
|
echo "::set-output name=name::${ARCHIVE_NAME}.zip"
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.package.outputs.name }}
|
name: ${{ steps.package.outputs.name }}
|
||||||
path: ${{ steps.package.outputs.file }}
|
path: ${{ steps.package.outputs.file }}
|
||||||
|
|
||||||
create-unix-binaries:
|
create-unix-binaries:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
if: github.repository == 'shssoichiro/oxipng'
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -71,10 +74,10 @@ jobs:
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
target: x86_64-apple-darwin
|
target: x86_64-apple-darwin
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
|
@ -118,20 +121,21 @@ jobs:
|
||||||
echo ::set-output "name=name::${ARCHIVE_NAME}.tar.gz"
|
echo ::set-output "name=name::${ARCHIVE_NAME}.tar.gz"
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.package.outputs.name }}
|
name: ${{ steps.package.outputs.name }}
|
||||||
path: ${{ steps.package.outputs.file }}
|
path: ${{ steps.package.outputs.file }}
|
||||||
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.repository == 'shssoichiro/oxipng'
|
||||||
needs: [create-windows-binaries, create-unix-binaries]
|
needs: [create-windows-binaries, create-unix-binaries]
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Get version and release description
|
- name: Get version and release description
|
||||||
id: tagName
|
id: tagName
|
||||||
|
|
@ -141,7 +145,7 @@ jobs:
|
||||||
echo "::set-output name=tag::$VERSION"
|
echo "::set-output name=tag::$VERSION"
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: ./binaries
|
path: ./binaries
|
||||||
|
|
||||||
|
|
|
||||||
27
.github/workflows/oxipng.yml
vendored
27
.github/workflows/oxipng.yml
vendored
|
|
@ -7,10 +7,13 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
- x86_64-unknown-linux-gnu
|
- x86_64-unknown-linux-gnu
|
||||||
|
|
@ -45,12 +48,25 @@ jobs:
|
||||||
toolchain: beta
|
toolchain: beta
|
||||||
- target: x86_64-unknown-linux-musl
|
- target: x86_64-unknown-linux-musl
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
- name: Install musl tools
|
- name: Install musl tools
|
||||||
run: sudo apt-get install musl-tools
|
run: sudo apt-get install musl-tools
|
||||||
if: "contains(matrix.target, 'musl')"
|
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 }}
|
- name: Install ${{ matrix.toolchain }}
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
|
@ -58,13 +74,6 @@ jobs:
|
||||||
toolchain: ${{ matrix.toolchain }}
|
toolchain: ${{ matrix.toolchain }}
|
||||||
override: true
|
override: true
|
||||||
components: clippy, rustfmt
|
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
|
- name: Run rustfmt
|
||||||
if: matrix.toolchain == 'stable'
|
if: matrix.toolchain == 'stable'
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue