update spec #2
This file contains hidden or 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: Build Kora Icon Theme RPM | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| build-rpm: | |
| runs-on: ubuntu-latest | |
| container: fedora:latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install build dependencies | |
| run: | | |
| dnf install -y rpm-build rpmdevtools git | |
| - name: Set up RPM build environment | |
| run: | | |
| rpmdev-setuptree | |
| - name: Determine version | |
| id: version | |
| run: | | |
| if [[ $GITHUB_REF == refs/tags/* ]]; then | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| else | |
| VERSION=$(date +%Y%m%d).git.$(git rev-parse --short HEAD) | |
| fi | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Building version: $VERSION" | |
| - name: Create source tarball | |
| run: | | |
| mkdir -p kora-icon-theme-${{ steps.version.outputs.VERSION }} | |
| # Copy only the main icon directories (adjust names as needed) | |
| if [ -d "kora" ]; then | |
| cp -r kora kora-icon-theme-${{ steps.version.outputs.VERSION }}/ | |
| fi | |
| # Copy MIME types | |
| if [ -d "mime" ]; then | |
| cp -r mime kora-icon-theme-${{ steps.version.outputs.VERSION }}/ | |
| fi | |
| # Copy any additional files (README, LICENSE, etc.) | |
| for file in README* LICENSE* COPYING* AUTHORS* CHANGELOG*; do | |
| if [ -f "$file" ]; then | |
| cp "$file" kora-icon-theme-${{ steps.version.outputs.VERSION }}/ | |
| fi | |
| done | |
| tar czf ~/rpmbuild/SOURCES/kora-icon-theme-${{ steps.version.outputs.VERSION }}.tar.gz kora-icon-theme-${{ steps.version.outputs.VERSION }} | |
| - name: Copy spec file | |
| run: | | |
| cp kora-icon-theme.spec ~/rpmbuild/SPECS/ | |
| - name: Build RPM | |
| run: | | |
| cd ~/rpmbuild/SPECS | |
| rpmbuild -ba kora-icon-theme.spec \ | |
| --define "version ${{ steps.version.outputs.VERSION }}" \ | |
| --define "_topdir $HOME/rpmbuild" | |
| - name: Upload RPM artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kora-icon-theme-rpm-${{ steps.version.outputs.VERSION }} | |
| path: | | |
| ~/rpmbuild/RPMS/noarch/*.rpm | |
| ~/rpmbuild/SRPMS/*.rpm | |
| retention-days: 30 | |
| - name: Create Release (on tags) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| ~/rpmbuild/RPMS/noarch/*.rpm | |
| ~/rpmbuild/SRPMS/*.rpm | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |