forked from pgcentralfoundation/pgrx
-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (59 loc) · 1.81 KB
/
upload-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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-musl
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: |
if [ "${{ matrix.os }}" = "ubuntu-22.04" ]; then
sudo apt install musl-tools
fi
rustup target add ${{ matrix.target }}
cargo build -p cargo-pgrx --bin cargo-pgrx --features cargo-edit/vendored-openssl --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