Merge pull request #38 from vendrinc/release_1.2.0 #54
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
aarch64-apple-darwin-release: | |
name: Build macOS ARM | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
target: aarch64-apple-darwin | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target aarch64-apple-darwin | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: aarch64-apple-darwin | |
path: target/aarch64-apple-darwin/release/pg_parcel | |
if-no-files-found: error | |
x86_64-apple-darwin-release: | |
name: Build macOS Intel | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
target: x86_64-apple-darwin | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target x86_64-apple-darwin | |
- name: Smoke test | |
run: target/x86_64-apple-darwin/release/pg_parcel --help | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: x86_64-apple-darwin | |
path: target/x86_64-apple-darwin/release/pg_parcel | |
if-no-files-found: error | |
macos-universal-release: | |
name: Build macOS Universal | |
runs-on: macos-latest | |
needs: [aarch64-apple-darwin-release, x86_64-apple-darwin-release] | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: x86_64-apple-darwin | |
path: pg_parcel-x86_64-apple-darwin | |
- uses: actions/download-artifact@v2 | |
with: | |
name: aarch64-apple-darwin | |
path: pg_parcel-aarch64-apple-darwin | |
- name: debug | |
run: find . | |
- name: Build Universal macOS Binary | |
run: | | |
lipo -create \ | |
-output pg_parcel-apple-darwin \ | |
pg_parcel-x86_64-apple-darwin/pg_parcel \ | |
pg_parcel-aarch64-apple-darwin/pg_parcel | |
- name: Smoke test | |
run: | | |
find . | |
ls -lR | |
chmod 0755 ./pg_parcel-apple-darwin | |
./pg_parcel-apple-darwin --help | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: apple-darwin | |
path: pg_parcel-apple-darwin | |
if-no-files-found: error | |
build-linux-release: | |
name: Build Linux | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install dev tools | |
run: | | |
sudo apt update | |
sudo apt -y install musl-tools libssl-dev | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
target: x86_64-unknown-linux-musl | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target x86_64-unknown-linux-musl | |
- name: Smoke test | |
run: target/x86_64-unknown-linux-musl/release/pg_parcel --help | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: linux | |
path: target/x86_64-unknown-linux-musl/release/pg_parcel | |
if-no-files-found: error | |
create-release: | |
name: Create release | |
needs: [macos-universal-release, build-linux-release] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: linux | |
path: linux | |
- uses: actions/download-artifact@v2 | |
with: | |
name: apple-darwin | |
- name: Rename executables | |
run: | | |
mv -v linux/pg_parcel pg_parcel-linux | |
find . | |
- uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
pg_parcel-apple-darwin | |
pg_parcel-linux | |
fail_on_unmatched_files: true |