-
Notifications
You must be signed in to change notification settings - Fork 39
115 lines (111 loc) · 3.49 KB
/
release.yaml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: release
on:
release:
types: [created]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
os:
- centos:7.4.1708
- centos:7.6.1810
- centos:7.7.1908
- centos:7.8.2003
- centos:7.9.2009
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
- fedora:37
- fedora:38
- fedora:39
- debian:10
- debian:11
- debian:12
- rhel:8.6
- rhel:8.7
- rhel:8.8
- rhel:9.0
- rhel:9.1
- rhel:9.2
- rhel:9.3
- almalinux:8.6
- almalinux:8.7
- almalinux:8.8
- almalinux:9.0
- almalinux:9.1
- almalinux:9.2
- almalinux:9.3
steps:
- uses: actions/checkout@v3
- name: OS Build
run: |
export full_tgtname=${{ matrix.os }}
export tgtname=$(echo ${{ matrix.os }} | tr -d ':')
.github/scripts/gen_dockerfile.sh
docker build ./ -t $tgtname
docker run \
-t --rm \
-v "$GITHUB_WORKSPACE:/source" \
-v "$GITHUB_WORKSPACE/target/$tgtname:/source/target" \
$tgtname \
cargo build --release;
shell: bash
- name: OS Create Package
run: |
tgtname=$(echo ${{ matrix.os }} | tr -d ':')
.github/scripts/package.sh $tgtname;
shell: bash
- name: Get Artifact Name
run: |
ARTIFACT_PATHNAME=$(ls ./bender-*.tar.gz | head -n 1)
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
shell: bash
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/tar.gz
release-gnu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
# Use container that supports old GLIBC versions and (hopefully) many linux OSs
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
- name: GNU Build
run: cargo build --release
- name: GNU Create Package
run: .github/scripts/package.sh
shell: bash
- name: Get Artifact Name
run: |
ARTIFACT_PATHNAME=$(ls ./bender-*.tar.gz | head -n 1)
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
shell: bash
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/tar.gz