This repository has been archived by the owner on Dec 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
74 lines (70 loc) · 2.89 KB
/
publish_dev_artifacts.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
name: Publish-Dev-Artifacts
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: '0'
CARGO_PROFILE_DEV_DEBUG: '0'
RUSTFLAGS: "-D warnings -W rust-2021-compatibility"
REPO_APT_DEV_URL: https://repo.stackable.tech/repository/deb-dev
REPO_RPM_DEV_URL: https://repo.stackable.tech/repository/rpm-dev
jobs:
debian10:
runs-on: debian10
steps:
- uses: actions/checkout@v2.3.5
- name: Change version if is PR
if: ${{ github.event_name == 'pull_request' }}
# We use "mr" instead of "pr" to denote pull request builds, as this prefix comes before "nightly" when lexically
# sorting packages by version. This means that when installing the package without specifying a version the
# nighly version is considered more current than mr versions and installed by default
run: sed -i -e 's/^version = "\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/version = "\1-mr${{ github.event.number }}"/' Cargo.toml
- name: Build
run: ~/.cargo/bin/cargo build --verbose --release
- name: Build apt package
run: ~/.cargo/bin/cargo deb --manifest-path Cargo.toml --no-build
- name: Publish apt package
env:
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
if: env.NEXUS_PASSWORD != null
run: >-
/usr/bin/curl
--fail
-u 'github:${{ secrets.NEXUS_PASSWORD }}'
-H "Content-Type: multipart/form-data"
--data-binary "@./$(find target/debian/ -name *.deb)"
"${{ env.REPO_APT_DEV_URL }}/"
- name: Clean
run: ~/.cargo/bin/cargo clean
centos:
runs-on: centos${{ matrix.node }}
strategy:
matrix:
node: [ 7, 8 ]
steps:
- uses: actions/checkout@v2.3.5
- name: Change version if is PR
if: ${{ github.event_name == 'pull_request' }}
# We use "mr" instead of "pr" to denote pull request builds, as this prefix comes before "nightly" when lexically
# sorting packages by version. This means that when installing the package without specifying a version the
# nighly version is considered more current than mr versions and installed by default
run: sed -i -e 's/^version = "\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/version = "\1-mr${{ github.event.number }}"/' Cargo.toml
- name: Build
run: ~/.cargo/bin/cargo build --verbose --release
- name: Build RPM package
run: packaging/buildrpm.sh stackable-agent
- name: Publish RPM package
env:
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
if: env.NEXUS_PASSWORD != null
run: >-
/usr/bin/curl
--fail
-u 'github:${{ secrets.NEXUS_PASSWORD }}'
--upload-file "./$(find target/rpm/RPMS/x86_64/ -name *.rpm)"
"${{ env.REPO_RPM_DEV_URL }}/el${{ matrix.node }}/"
- name: Clean
run: ~/.cargo/bin/cargo clean