oxipng/.github/workflows/deploy.yml
Luni-4 e4d4c93d9c
Add release description (#230)
* Add description to a release

* Fix typo
2020-05-15 15:07:03 -04:00

95 lines
2.5 KiB
YAML

name: deploy
on:
push:
tags:
- 'v*.*.*'
jobs:
create-binaries-windows:
strategy:
matrix:
conf:
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
include:
- conf: x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
- conf: i686-pc-windows-msvc
target: i686-pc-windows-msvc
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build oxipng
run: |
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
run: |
$OXIPNG_PATH="$Env:GITHUB_WORKSPACE\target\${{ matrix.target }}\release"
strip "$OXIPNG_PATH\oxipng.exe"
7z a oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}.zip `
"$OXIPNG_PATH\oxipng.exe"
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}
path: oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}.zip
deploy:
needs: create-binaries-windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get version and release description
id: tagName
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
tail -n +2 CHANGELOG.md | sed -e '/^$/,$d' > CHANGELOG.txt
echo "::set-output name=tag::$VERSION"
- name: Download x86_64 Windows artifact
uses: actions/download-artifact@v2
with:
name: oxipng-${{ steps.tagName.outputs.tag }}-x86_64-pc-windows-msvc
- name: Download i686 Windows artifact
uses: actions/download-artifact@v2
with:
name: oxipng-${{ steps.tagName.outputs.tag }}-i686-pc-windows-msvc
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.tagName.outputs.tag }}
body_path: CHANGELOG.txt
files: |
oxipng-${{ steps.tagName.outputs.tag }}-x86_64-pc-windows-msvc.zip
oxipng-${{ steps.tagName.outputs.tag }}-i686-pc-windows-msvc.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}