forked from t-rex-tileserver/t-rex
-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (137 loc) · 4.56 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
tgz:
name: Build release tgz
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-20.04', 'macOS-latest']
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cargo build
run: cargo build --release --no-default-features
- name: Tar
id: tar
shell: bash
run: |
VERSION=$(basename ${{ github.ref }})
target=$(gcc -dumpmachine)
cd target/release
strip t_rex
tar czf ../../t-rex-$VERSION-$target.tar.gz t_rex
echo "##[set-output name=tgz;]t-rex-$VERSION-$target.tar.gz"
- name: Upload Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.tar.outputs.tgz }}
body: |
See [CHANGELOG](https://github.com/t-rex-tileserver/t-rex/blob/master/CHANGELOG.md)
draft: true
prerelease: true
deb:
name: Build deb package
outputs:
asset_download_url: ${{ steps.upload_asset.outputs.upload_url }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-20.04']
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install libgdal-dev
run: sudo apt update && sudo apt install -y libgdal-dev
- run: cargo install cargo-deb
- name: cargo deb
run: |
cargo deb --variant focal
dpkg -I target/debian/t-rex*.deb
dpkg -c target/debian/t-rex*.deb
cargo deb --variant buster
cargo deb --variant bullseye
- name: Upload Release Asset
id: upload_asset
uses: softprops/action-gh-release@v1
with:
files: target/debian/*deb
draft: true
prerelease: true
msi:
name: Build MSI
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Install GDAL
shell: bash
run: |
curl -S -O https://download.gisinternals.com/sdk/downloads/release-1928-x64-dev.zip
7z x release-1928-x64-dev.zip
find release-1928-x64 -ls >release-1928-x64.txt
rm -rf release-1928-x64/bin/ms release-1928-x64/bin/proj release-1928-x64/bin/gdal/{csharp,java,python}
mv release-1928-x64/bin/gdal/apps/* release-1928-x64/bin/
- name: Build
shell: bash
run: |
rustc -Vv
cargo -V
vswhere
export GDAL_HOME=$PWD/release-1928-x64
export GDAL_DATA=$GDAL_HOME/bin/gdal-data
export PATH=$GDAL_HOME/bin:$PATH
ogrinfo --version
ogrinfo --formats
export GDAL_VERSION=$(ogrinfo --version | sed 's/GDAL \(.*\), .*/\1/')
echo $PATH
cargo build --release
target/release/t_rex --version
- name: Create msi
shell: bash
run: |
export VERSION=$(basename ${{ github.ref }})
export RELEASE_DIR=$PWD/target/release
export GDAL_HOME=$PWD/release-1928-x64
cd packaging/windows
"$WIX/bin/heat" dir $GDAL_HOME/bin -var wix.GdalSrcDir -dr BINDIR -nologo -srd -ag -sw5150 -cg gdal -o gdal.wxs
"$WIX/bin/candle" -nologo gdal.wxs
"$WIX/bin/candle" -nologo t-rex.wxs
"$WIX/bin/light" -nologo -dBuildDir=$RELEASE_DIR -dGdalSrcDir=$GDAL_HOME/bin -sice:ICE80 -o t-rex-$VERSION.msi t-rex.wixobj gdal.wixobj
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: packaging/windows/t-rex-*.msi
draft: true
prerelease: true
# docker-release:
# name: Docker release
# needs: [deb]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Build and publish
# uses: elgohr/Publish-Docker-Github-Action@master
# env:
# # Cannot download asset from draft release?
# DEB_URL: ${{ needs.deb.outputs.asset_download_url }}/t-rex-focal_0.14.1.pre5-1.focal_amd64.deb
# with:
# name: sourcepole/t-rex
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# workdir: packaging/docker
# buildargs: DEB_URL
# tag_names: true