Fix ecmwf script directory #13
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
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up RPM environment | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y rpm | |
mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
path: rpmbuild/SOURCES/${{ github.event.repository.name }} | |
- name: Build RPM package | |
run: | | |
rpmbuild -bb --define "_topdir ${{ github.workspace }}/rpmbuild" rpmbuild/SOURCES/${{ github.event.repository.name }}/*.spec | |
- name: Find RPM files | |
id: findrpm | |
run: | | |
echo "::set-output name=files::$(find rpmbuild/RPMS/ -type f -name "*.rpm")" | |
- name: Find SRPM files | |
id: findsrpm | |
run: | | |
echo "::set-output name=files::$(find rpmbuild/SRPMS/ -type f -name "*.src.rpm")" | |
- name: Create binary release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.repository.releases_url }} | |
asset_path: ${{ steps.findrpm.outputs.files }} | |
asset_name: ${{ steps.findrpm.outputs.files }} | |
asset_content_type: application/x-rpm | |
- name: Create source release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.repository.releases_url }} | |
asset_path: ${{ steps.findsrpm.outputs.files }} | |
asset_name: ${{ steps.findsrpm.outputs.files }} | |
asset_content_type: application/x-rpm |