forked from tiiuae/fog_sw
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (63 loc) · 2.29 KB
/
main.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
name: main
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'ver_ssrc_rel_*' # Push events to matching ver_ssrc_rel_*
jobs:
tii-deb:
runs-on: ubuntu-latest
steps:
- name: Checkout fog_sw
uses: actions/checkout@v2
with:
path: fog_sw
- name: Checkout ci-scripts
uses: actions/checkout@v2
with:
repository: tiiuae/fogsw-ci-scripts
path: fogsw-ci-scripts
# Run docker build
- name: Run fog-sw docker build
run: |
set -eux
mkdir bin
pushd fogsw-ci-scripts
./generate_deb.sh ../fog_sw ../bin/
popd
- name: Install jfrog CLI tool
env:
JFROG_CLI_URL: https://artifactory.ssrc.fi/artifactory/gen-public-local/tools/jfrog/jfrog-1.45.2.tar.gz
if: github.event_name == 'push'
run: |
set -exu
mkdir -p "$GITHUB_WORKSPACE/.jfrog/bin"
curl -L "$JFROG_CLI_URL" -o "$GITHUB_WORKSPACE/.jfrog/jfrog.tar.gz"
tar -C "$GITHUB_WORKSPACE/.jfrog/bin" -zxf "$GITHUB_WORKSPACE/.jfrog/jfrog.tar.gz"
echo "$GITHUB_WORKSPACE/.jfrog/bin" >> "$GITHUB_PATH"
echo "JFROG_CLI_HOME_DIR=$GITHUB_WORKSPACE/.jfrog" >> "$GITHUB_ENV"
- name: Upload to Artifactory
env:
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_REPO: debian-release-local
DISTRIBUTION: focal
COMPONENT: fog-sw
ARCHITECTURE: amd64
BUILD_NAME: fog-sw-full
CI: true
if: github.event_name == 'push'
run: |
set -exu
jfrog rt c import "$ARTIFACTORY_TOKEN"
jfrog rt ping
pkg=$(find bin -name 'fog-sw-full*.deb')
jfrog rt u --deb "$DISTRIBUTION/$COMPONENT/$ARCHITECTURE" \
--target-props COMMIT="$GITHUB_SHA" \
--build-name "$BUILD_NAME" \
--build-number "$GITHUB_SHA" \
"$pkg" \
"$ARTIFACTORY_REPO"
jfrog rt build-publish "$BUILD_NAME" "$GITHUB_SHA"
jfrog rt bpr "$BUILD_NAME" "$GITHUB_SHA" "$ARTIFACTORY_REPO" \
--status "${GITHUB_REF#refs/tags/}" \
--comment "fog-sw-full release build"