-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (109 loc) · 4.02 KB
/
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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
on:
release:
types:
- created
name: Continuous integration
env:
DEB_PKG_NAME: kinesis-tailr-${{ github.event.release.tag_name }}-x86_64.deb
RPM_PKG_NAME: kinesis-tailr-${{ github.event.release.tag_name }}-1.x86_64.rpm
ARCH_PKG_NAME: kinesis-tailr-bin-${{ github.event.release.tag_name }}-1-x86_64.pkg.tar.zst
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.73.0 # MSRV
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/release
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: System dependencies
run: |
sudo apt-get update
sudo apt-get install -y sudo make alien
mkdir -p ~/.cargo/release
- name: Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- uses: davidB/rust-cargo-make@v1
- uses: taiki-e/install-action@nextest
- name: Build
run: cargo make all
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
- name: Create Debian package
env:
DESTDIR: '~/kinesis-tailr-deb'
run: |
mkdir -p $DESTDIR
RELEASE_VERSION=${{ github.event.release.tag_name }} DESTDIR=$DESTDIR cargo make debian-pkg
- name: Upload Debian release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ env.DEB_PKG_NAME }}
${{ env.DEB_PKG_NAME }}.md5sum
centos:
runs-on: ubuntu-latest
needs: [ci]
steps:
- name: System dependencies
run: |
sudo apt-get update
sudo apt-get install -y sudo make alien
- name: Create CentOS 8 package
run: |
wget https://github.com/grumlimited/kinesis-tailr/releases/download/${{ github.event.release.tag_name }}/${DEB_PKG_NAME} -O ${DEB_PKG_NAME}
alien -r -k --scripts --target=x86_64 ${DEB_PKG_NAME}
md5sum ${RPM_PKG_NAME} >> ${RPM_PKG_NAME}.md5sum
- name: Upload CentOS 8 release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ env.RPM_PKG_NAME }}
${{ env.RPM_PKG_NAME }}.md5sum
arch:
runs-on: ubuntu-latest
needs: [ci]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare arch package metadata
run: |
wget https://github.com/grumlimited/kinesis-tailr/releases/download/${{ github.event.release.tag_name }}/${DEB_PKG_NAME} -O build-aux/arch/kinesis-tailr-bin/${DEB_PKG_NAME}
MD5_SUM=$(md5sum build-aux/arch/kinesis-tailr-bin/${DEB_PKG_NAME} | awk '{print $1}')
awk -v q="'" -v MD5_SUM=$MD5_SUM -i inplace 'BEGINFILE{print "md5sums=(" q MD5_SUM q ")"}{print}' build-aux/arch/kinesis-tailr-bin/PKGBUILD
awk -i inplace 'BEGINFILE{print "pkgver=${{ github.event.release.tag_name }}"}{print}' build-aux/arch/kinesis-tailr-bin/PKGBUILD
- name: Validate PKGBUILD
id: validate-pkgbuild
uses: 2m/[email protected]
with:
debug: true
target: pkgbuild
pkgname: build-aux/arch/kinesis-tailr-bin/
- name: Create arch package checksum file
run: |
sudo chown -R $USER .
md5sum build-aux/arch/kinesis-tailr-bin/${ARCH_PKG_NAME} >> build-aux/arch/kinesis-tailr-bin/${ARCH_PKG_NAME}.md5sum
- name: Upload Arch Linux release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
build-aux/arch/kinesis-tailr-bin/${{ env.ARCH_PKG_NAME }}
build-aux/arch/kinesis-tailr-bin/${{ env.ARCH_PKG_NAME }}.md5sum