-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (83 loc) · 3.74 KB
/
cli-bleeding.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
name: 'Bleeding edge CI builds for watney-solve CLI and Desktop apps'
on:
workflow_dispatch:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
paths:
- 'src/WatneyAstrometry.SolverApp/**'
- 'src/WatneyAstrometry.Core/**'
- 'src/WatneyAstrometry.ImageReaders/**'
- 'src/WatneyAstrometry.SolverVizTools/**'
env:
PKG_PREFIX: 'watney-solve-bleeding'
PKG_PREFIX_LATEST: 'watney-solve-bleeding-latest'
OSARCHS_ALL: win-x64 linux-x64 linux-arm64 linux-arm osx-x64
OSARCHS_WIN: win-x64
OSARCHS_OTHER: linux-x64 linux-arm64 linux-arm osx-x64
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set build vars
id: buildvars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" && echo "::set-output name=buildtime::$(date +'%Y%m%d_%H%M')"
- name: Set package name vars
id: pkgnames
run: echo "::set-output name=prefix::${{ env.PKG_PREFIX }}-${{ steps.buildvars.outputs.buildtime }}-${{ steps.buildvars.outputs.sha_short }}"
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Replace commit hash in readmes
run: |
sed -i 's/COMMIT_HASH/${{ steps.buildvars.outputs.sha_short }}/g' builds/cli/notices/README-BLEEDING
sed -i 's/COMMIT_HASH/${{ steps.buildvars.outputs.sha_short }}/g' builds/desktop/notices/README-BLEEDING
- name: Build all architectures (CLI)
run: |
for a in $OSARCHS_ALL
do
dotnet publish --version-suffix bleeding-${{ steps.buildvars.outputs.sha_short }} -c Release -r $a --self-contained true src/WatneyAstrometry.SolverApp/WatneyAstrometry.SolverApp.csproj -o $PKG_PREFIX-$a/ && cp builds/cli/notices/* $PKG_PREFIX-$a && cp $PKG_PREFIX-$a/watney-solve-config.template.yml $PKG_PREFIX-$a/watney-solve-config.yml
done
- name: Build all architectures (DesktopApp)
run: |
for a in $OSARCHS_ALL
do
dotnet publish --version-suffix bleeding-${{ steps.buildvars.outputs.sha_short }} -c Release -r $a --self-contained true -p:PublishSingleFile=true src/WatneyAstrometry.SolverVizTools/WatneyAstrometry.SolverVizTools.csproj -o $PKG_PREFIX-desktop-$a/ && cp builds/desktop/notices/* $PKG_PREFIX-desktop-$a
done
- name: Install zip
uses: montudor/action-zip@v1
- name: Zip windows binaries (CLI)
run: |
for a in $OSARCHS_WIN
do
zip -r ${{ steps.pkgnames.outputs.prefix }}-$a.zip $PKG_PREFIX-$a/ && cp ${{ steps.pkgnames.outputs.prefix }}-$a.zip $PKG_PREFIX-latest-$a.zip
done
- name: Zip windows binaries (DesktopApp)
run: |
for a in $OSARCHS_WIN
do
zip -r ${{ steps.pkgnames.outputs.prefix }}-desktop-$a.zip $PKG_PREFIX-desktop-$a/ && cp ${{ steps.pkgnames.outputs.prefix }}-desktop-$a.zip $PKG_PREFIX-desktop-latest-$a.zip
done
- name: Tar linux and osx binaries (CLI)
run: |
for a in $OSARCHS_OTHER
do
tar -czf ${{ steps.pkgnames.outputs.prefix }}-$a.tar.gz $PKG_PREFIX-$a/ && cp ${{ steps.pkgnames.outputs.prefix }}-$a.tar.gz $PKG_PREFIX-latest-$a.tar.gz
done
- name: Tar linux and osx binaries (DesktopApp)
run: |
for a in $OSARCHS_OTHER
do
tar -czf ${{ steps.pkgnames.outputs.prefix }}-desktop-$a.tar.gz $PKG_PREFIX-desktop-$a/ && cp ${{ steps.pkgnames.outputs.prefix }}-desktop-$a.tar.gz $PKG_PREFIX-desktop-latest-$a.tar.gz
done
- uses: pyTooling/Actions/releaser/composite@main
name: Releaser
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: '${{ env.PKG_PREFIX }}-*'
tag: 'bleeding-cli'