-
-
Notifications
You must be signed in to change notification settings - Fork 233
138 lines (117 loc) · 4.83 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
# Deploys PCP to Packagecloud
name: Release
on:
push:
tags:
- '*.*.*'
- '!*alpha'
- '!*beta'
workflow_dispatch:
permissions:
contents: write
jobs:
qa:
name: ${{ matrix.platform }}
if: github.repository == 'performancecopilot/pcp' || github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# run all PCP builds in containers, because the GitHub Actions images contain
# different packages than the stock Ubuntu releases
- {platform: debian10-container, os: ubuntu-20.04}
- {platform: debian11-container, os: ubuntu-20.04}
- {platform: debian12-container, os: ubuntu-20.04}
- {platform: ubuntu1804-container, os: ubuntu-20.04}
- {platform: ubuntu2004-container, os: ubuntu-20.04}
- {platform: ubuntu2204-container, os: ubuntu-20.04}
- {platform: fedora36-container, os: ubuntu-20.04}
- {platform: fedora37-container, os: ubuntu-20.04}
- {platform: fedora38-container, os: ubuntu-20.04}
- {platform: centos6-container, os: ubuntu-20.04}
- {platform: centos7-container, os: ubuntu-20.04}
- {platform: centos-stream8-container, os: ubuntu-20.04}
- {platform: centos-stream9-container, os: ubuntu-20.04}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Fix local hostname DNS lookup
run: echo 127.0.1.1 $(hostname --fqdn) $(hostname) | sudo tee -a /etc/hosts
- name: Setup
run: |
python3 -c 'import yaml' || pip3 install pyyaml
mkdir -p artifacts/build artifacts/test
build/ci/ci-run.py ${{ matrix.platform }} setup
- name: Build
run: build/ci/ci-run.py ${{ matrix.platform }} task build
- name: Copy build artifacts
run: build/ci/ci-run.py ${{ matrix.platform }} artifacts build --path artifacts/build
- name: Publish build artifacts
uses: actions/upload-artifact@v3
with:
name: build-${{ matrix.platform }}
path: artifacts/build
- name: Install
run: build/ci/ci-run.py ${{ matrix.platform }} task install
- name: Initialize QA
id: init_qa
run: build/ci/ci-run.py ${{ matrix.platform }} task init_qa
- name: QA (sanity group)
run: build/ci/ci-run.py ${{ matrix.platform }} task qa_sanity
- name: Copy test results
# always() is required here to run this step even if the QA step fails
if: always() && steps.init_qa.outcome == 'success'
run: build/ci/ci-run.py ${{ matrix.platform }} artifacts test --path artifacts/test
- name: Publish test results
if: always() && steps.init_qa.outcome == 'success'
uses: actions/upload-artifact@v3
with:
name: test-${{ matrix.platform }}
path: artifacts/test
release:
name: Release packages
if: github.repository == 'performancecopilot/pcp' || github.event_name == 'workflow_dispatch'
needs: qa
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Discover artifacts
run: find artifacts | xargs ls -l
- name: Create source tarball
run: ./Makepkgs --source --nonrpm
- name: Create release tarballs
run: |
mkdir archives; for build in artifacts/build-*; do tar -czvf archives/$(basename $build | sed -E 's/^build-//' | sed -E 's/-container$//').tar.gz -C $build $(find $build -type f ! -name "pcp-testsuite*" ! -name "pcp-*.src.rpm" -printf '%f '); done
- name: Release tarballs on github
uses: softprops/action-gh-release@v1
with:
files: |
archives/*
build/tar/*.src.tar.gz
- name: Release on Packagecloud
run: build/ci/packagecloud.sh
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
# - name: Release on Artifactory
# run: |
# export PYTHONUNBUFFERED=1
# . VERSION.pcp
# build/ci/artifactory.py deploy \
# --maturity release \
# --version "$PACKAGE_MAJOR.$PACKAGE_MINOR.$PACKAGE_REVISION" \
# --build_name "${GITHUB_WORKFLOW}" \
# --build_number "${GITHUB_RUN_ID}" \
# --source build/tar/*.src.tar.gz \
# --exclude 'pcp-testsuite.*' \
# --exclude 'pcp-.+\.src\.rpm' \
# artifacts/build-*
# env:
# ARTIFACTORY_USER: github-actions
# ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
# ARTIFACTORY_GPG_PASSPHRASE: ${{ secrets.ARTIFACTORY_GPG_PASSPHRASE }}