-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github actions workflow added for COPR and OBS
- Loading branch information
Showing
1 changed file
with
81 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,81 @@ | ||
# This is workflow to build rpms using the SPEC file | ||
# The Copr build service is used | ||
|
||
name: rpmbuild_copr | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
# Looks there are no or not many native fedora-runners, hence we use a container | ||
container: fedora:latest | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
# That workspace (the directory) is different from the RPMBUILD space | ||
- uses: actions/checkout@v3 | ||
|
||
# Install rpm and copr tools | ||
- name: Install tooling for source RPM build | ||
run: dnf -y install @development-tools @rpm-development-tools copr-cli make git | ||
|
||
# Get/download the source files to the right place | ||
- name: Get the sources for RPM package | ||
run: ./getsources.sh | ||
|
||
# Build the SRPM package | ||
- name: Build the source RPM | ||
run: rpmbuild -bs *.spec | ||
|
||
# setup COPR Authentication | ||
# You need to store your Copr authenication data under | ||
# Settings -> Actions -> Repository secrets | ||
- name: Install API token for copr-cli | ||
env: | ||
API_TOKEN_CONTENT: ${{ secrets.COPR_API_TOKEN }} | ||
run: | | ||
mkdir -p "$HOME/.config" | ||
echo "$API_TOKEN_CONTENT" > "$HOME/.config/copr" | ||
# Submit COPR build | ||
# The path is not the $GITHUB_WORKSPACE it is the RPMBUILD space | ||
- name: Submit the copr build | ||
run: copr-cli build --nowait fetchmail7 /github/home/rpmbuild/SRPMS/*.src.rpm | ||
|
||
#### And we take care of the OBS part | ||
|
||
# Install osc tools | ||
- name: Install tooling for openbuild service | ||
run: dnf -y install osc wget | ||
|
||
# setup OBS Authentication | ||
# You need to store your OBS authenication data under | ||
# Settings -> Actions -> Repository secrets | ||
- name: Install API token for osb | ||
env: | ||
API_TOKEN_CONTENT: ${{ secrets.OBS_API_TOKEN }} | ||
run: | | ||
mkdir -p "$HOME/.config/osc" | ||
echo "$API_TOKEN_CONTENT" > "$HOME/.config/osc/oscrc" | ||
# prepare and trigger OBS package build | ||
- name: prepare and trigger OBS package build | ||
# we capture the commit message to use it for the obs submit | ||
env: | ||
MY_GITHUB_COMMIT_MSG: ${{ github.event.head_commit.message }} | ||
run: ./submitobsbuild.sh | ||
|