-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENT-5542: Build package using GitHub Actions
* Card ID: ENT-5542 (Cherry-picked from 9fa7469)
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: tito | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tito: | ||
name: "tito" | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: "CentOS 7" | ||
image: "quay.io/centos/centos:centos7" | ||
|
||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ matrix.image }} | ||
|
||
steps: | ||
- name: Enable EPEL repository | ||
run: | | ||
yum install -y epel-release | ||
- name: Install core packages | ||
run: | | ||
yum install -y \ | ||
git-core dnf-plugins-core rpm-build sudo which make | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# We need to initiate the repository manually because Actions fallback | ||
# to REST API with Git < 2.18; CentOS 7/RHEL 7 have 1.8. | ||
# See https://github.com/actions/checkout#checkout-v3 | ||
# Trust is required so Tito can properly read git history | ||
# See https://github.com/actions/checkout/issues/766 | ||
- name: Initiate new git repository | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "RHSM for RHEL 7 at GitHub Actions" | ||
git init | ||
git add . | ||
git commit -m "Detached commit" | ||
git config --global --add safe.directory '*' | ||
- name: Install packages | ||
run: | | ||
yum install -y npm | ||
npm install -g yarn | ||
yum-builddep -y subscription-manager.spec | ||
- name: Install tito | ||
run: | | ||
yum install -y tito | ||
- name: Build the package | ||
run: | | ||
tito build --output=tito/ --test --rpm | ||
- name: Upload RPMs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: RPMs from tito (${{ matrix.name }}) | ||
path: tito/ | ||
retention-days: 7 |