Update deploy script (#229)
This commit is contained in:
parent
9849adcbd1
commit
0a51fb06ea
1 changed files with 37 additions and 13 deletions
50
.github/workflows/deploy.yml
vendored
50
.github/workflows/deploy.yml
vendored
|
|
@ -6,8 +6,9 @@ on:
|
||||||
- 'v*.*.*'
|
- 'v*.*.*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
create-binaries-windows:
|
create-binaries-windows:
|
||||||
runs-on: windows-latest
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
conf:
|
conf:
|
||||||
|
|
@ -18,52 +19,75 @@ jobs:
|
||||||
target: x86_64-pc-windows-msvc
|
target: x86_64-pc-windows-msvc
|
||||||
- conf: i686-pc-windows-msvc
|
- conf: i686-pc-windows-msvc
|
||||||
target: i686-pc-windows-msvc
|
target: i686-pc-windows-msvc
|
||||||
|
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: olegtarasov/get-tag@v2
|
|
||||||
id: tagName
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.target }}
|
|
||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
target: ${{ matrix.target }}
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
- name: Build oxipng
|
- name: Build oxipng
|
||||||
run: |
|
run: |
|
||||||
cargo build --release --target ${{ matrix.target }}
|
cargo build --release --target ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: Get the version
|
||||||
|
shell: bash
|
||||||
|
id: tagName
|
||||||
|
run: |
|
||||||
|
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
|
||||||
|
echo "::set-output name=tag::$VERSION"
|
||||||
|
|
||||||
- name: Create zip
|
- name: Create zip
|
||||||
run: |
|
run: |
|
||||||
$OXIPNG_PATH="$Env:GITHUB_WORKSPACE\target\${{ matrix.target }}\release"
|
$OXIPNG_PATH="$Env:GITHUB_WORKSPACE\target\${{ matrix.target }}\release"
|
||||||
strip "$OXIPNG_PATH\oxipng.exe"
|
strip "$OXIPNG_PATH\oxipng.exe"
|
||||||
7z a oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}.zip "$OXIPNG_PATH\oxipng.exe"
|
7z a oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}.zip `
|
||||||
|
"$OXIPNG_PATH\oxipng.exe"
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}
|
name: oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}
|
||||||
path: oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}.zip
|
path: oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}.zip
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
|
||||||
needs: create-binaries-windows
|
needs: create-binaries-windows
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: olegtarasov/get-tag@v2
|
|
||||||
|
- name: Get the version
|
||||||
id: tagName
|
id: tagName
|
||||||
- name: Download x86_64 Windows
|
run: |
|
||||||
uses: actions/download-artifact@v1
|
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
|
||||||
|
echo "::set-output name=tag::$VERSION"
|
||||||
|
|
||||||
|
- name: Download x86_64 Windows artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: oxipng-${{ steps.tagName.outputs.tag }}-x86_64-pc-windows-msvc
|
name: oxipng-${{ steps.tagName.outputs.tag }}-x86_64-pc-windows-msvc
|
||||||
- name: Download i686 Windows
|
|
||||||
uses: actions/download-artifact@v1
|
- name: Download i686 Windows artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: oxipng-${{ steps.tagName.outputs.tag }}-i686-pc-windows-msvc
|
name: oxipng-${{ steps.tagName.outputs.tag }}-i686-pc-windows-msvc
|
||||||
|
|
||||||
- name: Create a release
|
- name: Create a release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.tagName.outputs.tag }}
|
name: ${{ steps.tagName.outputs.tag }}
|
||||||
files: |
|
files: |
|
||||||
oxipng-${{ steps.tagName.outputs.tag }}-x86_64-pc-windows-msvc/oxipng-${{ steps.tagName.outputs.tag }}-x86_64-pc-windows-msvc.zip
|
oxipng-${{ steps.tagName.outputs.tag }}-x86_64-pc-windows-msvc.zip
|
||||||
oxipng-${{ steps.tagName.outputs.tag }}-i686-pc-windows-msvc/oxipng-${{ steps.tagName.outputs.tag }}-i686-pc-windows-msvc.zip
|
oxipng-${{ steps.tagName.outputs.tag }}-i686-pc-windows-msvc.zip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue