-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
17,044 additions
and
3,251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Packaging for Centos and Fedora | ||
name: Packaging for RPM | ||
|
||
on: | ||
push: | ||
|
@@ -7,40 +7,130 @@ on: | |
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ matrix.target }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: | ||
- amd64 | ||
target: | ||
- "centos:7" | ||
- "fedora:35" | ||
- "fedora:36" | ||
- "rockylinux:8.5" | ||
- "almalinux:8.5" | ||
|
||
|
||
steps: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ matrix.target }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: | ||
- amd64 | ||
target: | ||
- "rockylinux:8" | ||
- "rockylinux:9" | ||
- "fedora:37" | ||
- "fedora:38" | ||
- "centos:7" | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Install prereq packages | ||
run: ./rpmpkg-setup.sh ${{ matrix.target }} | ||
- name: Build packages | ||
run: ./rpmpkg-build.sh ${{ matrix.target }} | ||
- name: Store packages | ||
run: ./rpmpkg-build.sh | ||
- name: Set environment variables for upload | ||
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV | ||
- name: Copy packages to uploadable location | ||
run: | | ||
export DIRNAME=`echo ${{ matrix.target }} | tr ':' '_'` | ||
mkdir -p packages/${DIRNAME} | ||
cp ~/rpmbuild/RPMS/x86_64/*.rpm packages/${DIRNAME}/ | ||
- name: Publish packages to cloudsmith | ||
uses: salcock/action-cloudsmith-upload-[email protected] | ||
- name: Store packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: packages/ | ||
repo: ${{ secrets.CLOUDSMITH_OWNER }}/openli | ||
username: salcock | ||
api_key: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
name: packages-${{ env.DIRNAME }} | ||
path: packages/${{ env.DIRNAME }}/*.rpm | ||
retention-days: 1 | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ matrix.target }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: | ||
- amd64 | ||
target: | ||
- "rockylinux:8" | ||
- "rockylinux:9" | ||
- "fedora:37" | ||
- "fedora:38" | ||
- "centos:7" | ||
needs: build | ||
steps: | ||
- name: Set environment variables for download | ||
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV | ||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages-${{ env.DIRNAME }} | ||
- name: Add repositories | ||
env: | ||
TARGET: ${{ matrix.target }} | ||
run: | | ||
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandio/cfg/setup/bash.rpm.sh' | bash | ||
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandder/cfg/setup/bash.rpm.sh' | bash | ||
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libtrace/cfg/setup/bash.rpm.sh' | bash | ||
curl -1sLf 'https://dl.cloudsmith.io/public/wand/openli/cfg/setup/bash.rpm.sh' | bash | ||
curl -1sLf https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey -o packagecloud-rabbitmq-key.asc | ||
gpg --import packagecloud-rabbitmq-key.asc | ||
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | bash | ||
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | bash | ||
if [ "${TARGET}" == "centos:7" ]; then | ||
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || true | ||
fi | ||
if [[ "${TARGET}" =~ rocky* ]]; then | ||
dnf install -y dnf-plugins-core epel-release || true | ||
dnf config-manager --set-enabled powertools || true | ||
/usr/bin/crb enable || true | ||
fi | ||
- name: Test package install | ||
run: | | ||
yum install -y findutils | ||
find . -name "*.rpm" | xargs yum install -y | ||
- name: Test package removal | ||
run: | | ||
rpm -e openli-provisioner | ||
rpm -e openli-collector | ||
rpm -e openli-mediator | ||
publish: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ matrix.target }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: | ||
- amd64 | ||
target: | ||
- "rockylinux:8" | ||
- "rockylinux:9" | ||
- "fedora:37" | ||
- "fedora:38" | ||
- "centos:7" | ||
needs: test | ||
steps: | ||
- name: Set environment variables for download | ||
run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV | ||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages-${{ env.DIRNAME }} | ||
- name: Copy packages | ||
run: | | ||
mkdir -p packages/${DIRNAME} | ||
yum install -y findutils | ||
find . -name "*.rpm" | xargs cp -t packages/${DIRNAME}/ | ||
- name: Publish package to cloudsmith | ||
uses: wanduow/action-cloudsmith-upload-packages@v1 | ||
with: | ||
path: packages/ | ||
repo: ${{ secrets.CLOUDSMITH_OWNER }}/openli | ||
username: salcock | ||
api_key: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.