Build more release binaries
Include a static Linux binary with musl and a macOS build. Also add readme, license and changelog to the release archives. Fixes GH-134
This commit is contained in:
parent
974dfcfeac
commit
f26a9c75a8
1 changed files with 42 additions and 24 deletions
66
.github/workflows/deploy.yml
vendored
66
.github/workflows/deploy.yml
vendored
|
|
@ -7,20 +7,22 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
create-binaries-windows:
|
create-binaries:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
conf:
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||||
- x86_64-pc-windows-msvc
|
|
||||||
- i686-pc-windows-msvc
|
|
||||||
include:
|
include:
|
||||||
- conf: x86_64-pc-windows-msvc
|
- os: ubuntu-latest
|
||||||
|
target: x86_64-unknown-linux-musl
|
||||||
|
- os: macOS-latest
|
||||||
|
target: x86_64-apple-darwin
|
||||||
|
- os: windows-latest
|
||||||
target: x86_64-pc-windows-msvc
|
target: x86_64-pc-windows-msvc
|
||||||
- conf: i686-pc-windows-msvc
|
- os: windows-latest
|
||||||
target: i686-pc-windows-msvc
|
target: i686-pc-windows-msvc
|
||||||
|
|
||||||
runs-on: windows-latest
|
runs-on: '${{ matrix.os }}'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -33,10 +35,18 @@ jobs:
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
|
- name: Install musl
|
||||||
|
run: sudo apt-get install musl-tools
|
||||||
|
if: contains(matrix.target, 'linux-musl')
|
||||||
|
|
||||||
- name: Build oxipng
|
- name: Build oxipng
|
||||||
run: |
|
run: |
|
||||||
cargo build --release --target ${{ matrix.target }}
|
cargo build --release --target ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: Strip binary
|
||||||
|
run: strip 'target/${{ matrix.target }}/release/oxipng'
|
||||||
|
if: "!contains(matrix.target, 'windows')"
|
||||||
|
|
||||||
- name: Get the version
|
- name: Get the version
|
||||||
shell: bash
|
shell: bash
|
||||||
id: tagName
|
id: tagName
|
||||||
|
|
@ -44,22 +54,35 @@ jobs:
|
||||||
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
|
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
|
||||||
echo "::set-output name=tag::$VERSION"
|
echo "::set-output name=tag::$VERSION"
|
||||||
|
|
||||||
- name: Create zip
|
- name: Build package
|
||||||
|
id: package
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
$OXIPNG_PATH="$Env:GITHUB_WORKSPACE\target\${{ matrix.target }}\release"
|
ARCHIVE_NAME="oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}"
|
||||||
strip "$OXIPNG_PATH\oxipng.exe"
|
if [[ '${{ matrix.target }}' == *windows* ]]; then
|
||||||
7z a oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}.zip `
|
ARCHIVE_FILE="${ARCHIVE_NAME}.zip"
|
||||||
"$OXIPNG_PATH\oxipng.exe"
|
mv LICENSE LICENSE.txt
|
||||||
|
7z a "${ARCHIVE_FILE}" "./target/${{ matrix.target }}/release/oxipng.exe" ./CHANGELOG.md ./LICENSE.txt ./README.md
|
||||||
|
echo ::set-output "name=file::${ARCHIVE_FILE}"
|
||||||
|
echo ::set-output "name=name::${ARCHIVE_NAME}.zip"
|
||||||
|
else
|
||||||
|
ARCHIVE_FILE="${ARCHIVE_NAME}.tar.gz"
|
||||||
|
mkdir "/tmp/${ARCHIVE_NAME}"
|
||||||
|
cp README.md CHANGELOG.md LICENSE "target/${{ matrix.target }}/release/oxipng" "/tmp/${ARCHIVE_NAME}"
|
||||||
|
tar -czf "${PWD}/${ARCHIVE_FILE}" -C /tmp/ "${ARCHIVE_NAME}"
|
||||||
|
echo ::set-output "name=file::${ARCHIVE_FILE}"
|
||||||
|
echo ::set-output "name=name::${ARCHIVE_NAME}.tar.gz"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}
|
name: ${{ steps.package.outputs.name }}
|
||||||
path: oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}.zip
|
path: ${{ steps.package.outputs.file }}
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
|
||||||
needs: create-binaries-windows
|
needs: create-binaries
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
|
@ -73,15 +96,10 @@ jobs:
|
||||||
tail -n +2 CHANGELOG.md | sed -e '/^$/,$d' > CHANGELOG.txt
|
tail -n +2 CHANGELOG.md | sed -e '/^$/,$d' > CHANGELOG.txt
|
||||||
echo "::set-output name=tag::$VERSION"
|
echo "::set-output name=tag::$VERSION"
|
||||||
|
|
||||||
- name: Download x86_64 Windows artifact
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: oxipng-${{ steps.tagName.outputs.tag }}-x86_64-pc-windows-msvc
|
path: ./binaries
|
||||||
|
|
||||||
- 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
|
- name: Create a release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|
@ -89,7 +107,7 @@ jobs:
|
||||||
name: v${{ steps.tagName.outputs.tag }}
|
name: v${{ steps.tagName.outputs.tag }}
|
||||||
body_path: CHANGELOG.txt
|
body_path: CHANGELOG.txt
|
||||||
files: |
|
files: |
|
||||||
oxipng-${{ steps.tagName.outputs.tag }}-x86_64-pc-windows-msvc.zip
|
./binaries/**/*.zip
|
||||||
oxipng-${{ steps.tagName.outputs.tag }}-i686-pc-windows-msvc.zip
|
./binaries/**/*.tar.gz
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue