Skip to content

Commit

Permalink
add support for cargo-binstall
Browse files Browse the repository at this point in the history
  • Loading branch information
usamoi committed Dec 9, 2024
1 parent eda7549 commit 1f1dda3
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/upload-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: upload release

on:
workflow_dispatch:
inputs:
tag:
type: string
description: Tag
required: true

permissions:
contents: write

jobs:
upload-release:
name: upload-release
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
pkg_fmt: .tar.gz
binary_ext: ''
- os: macos-13
target: x86_64-apple-darwin
pkg_fmt: .tar.gz
binary_ext: ''
- os: macos-14
target: aarch64-apple-darwin
pkg_fmt: .tar.gz
binary_ext: ''
- os: windows-2022
target: x86_64-pc-windows-msvc
pkg_fmt: .zip
binary_ext: .exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag }}
- name: Upload cargo-pgrx
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
cargo build -p cargo-pgrx --bin cargo-pgrx --target ${{ matrix.target }} --release
mkdir -p build
cp README.md ./build/
cp LICENSE ./build/
cp ./target/${{ matrix.target }}/release/cargo-pgrx${{ matrix.binary_ext }} ./build/
DIST=cargo-pgrx-${{ github.event.inputs.tag }}-${{ matrix.target }}${{ matrix.pkg_fmt }}
if [ "${{ matrix.os }}" = "windows-2022" ]; then
(cd build && 7z a ../$DIST .)
else
tar czf $DIST -C build .
fi
gh release upload ${{ github.event.inputs.tag }} $DIST

0 comments on commit 1f1dda3

Please sign in to comment.