Workflow file for this run
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
name: Create RPM and DEB packages on release | |
on: | |
push: | |
tags: | |
- '*' | |
release: | |
types: [created] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox tox-gh-actions | |
- name: Test with tox | |
run: tox | |
build-sdist: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
steps: | |
- name: Get cASO repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref_name }} | |
- name: Build sdist file | |
run: python setup.py sdist | |
- name: Upload sidst to be used for other jobs | |
uses: actions/upload-artifact@v3 | |
with: | |
path: dist/caso-${{ github.ref_name }}.tar.gz | |
name: caso-${{ github.ref_name }}.tar.gz | |
- name: Update source distribution artifacts to release | |
if: github.event_name == 'release' | |
uses: AButler/upload-release-assets@v2.0 | |
with: | |
files: 'dist/*tar.gz' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
release-tag: ${{ github.ref_name }} | |
build-deb: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
- build-sdist | |
steps: | |
- name: Get cASO repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref_name }} | |
- name: Copy debian file into the correct place for the build | |
run: cp -r packaging/debian debian | |
- name: Install Debian deps | |
run: sudo apt-get install -y dpkg-dev debhelper devscripts lintian python3-pip tox dh-python python3-all python3-all-dev python3-pbr | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Download sdist artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: caso-${{ github.ref_name }}.tar.gz | |
path: dist | |
- name: Copy sdist to expected debian source file | |
run: cp dist/caso-${{ github.ref_name }}.tar.gz ../caso-${{ github.ref_name }}.orig.tar.gz | |
- name: Now build package | |
run: dpkg-buildpackage -b | |
- name: debug | |
run: ls | |
- name: debug | |
run: ls .. | |
- name: Update DEB artifacts to release | |
if: github.event_name == 'release' | |
uses: AButler/upload-release-assets@v2.0 | |
with: | |
files: '../*deb' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
release-tag: ${{ github.ref_name }} | |
build-rpm: | |
runs-on: ubuntu-latest | |
needs: | |
- build-sdist | |
- test | |
steps: | |
- name: Get cASO repo | |
uses: actions/checkout@v3 | |
with: | |
repository: IFCA/caso | |
ref: ${{ github.ref_name }} | |
- name: Download sdist artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: caso-${{ github.ref_name }}.tar.gz | |
path: dist | |
- name: debug | |
run: ls | |
- name: Build RPM package | |
id: rpm | |
uses: alvarolopez/rpmbuild@rockylinux9 | |
with: | |
source_file: dist/caso-${{ github.ref_name}}.tar.gz | |
spec_file: "packaging/redhat/caso.spec" | |
- name: Update RPM artifacts to release | |
if: github.event_name == 'release' | |
uses: AButler/upload-release-assets@v2.0 | |
with: | |
files: '${{ steps.rpm.outputs.rpm_dir_path }}/*/*rpm' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} |