diff --git a/.github/actions/build-rpm/action.yml b/.github/actions/build-rpm/action.yml new file mode 100644 index 0000000..2193288 --- /dev/null +++ b/.github/actions/build-rpm/action.yml @@ -0,0 +1,16 @@ +--- + +name: Build RPM +description: Use git-rpm-tools to build self as RPM and SRPM +runs: + using: "composite" + steps: + - name: Switch to branch to leave detached head state + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + git checkout -b gha-build + shell: bash + + - name: Build RPMs and SRPMs + run: ./scripts/git-rpm-tools -v -x ba + shell: bash diff --git a/.github/workflows/publish-rpm-on-release.yml b/.github/workflows/publish-rpm-on-release.yml new file mode 100644 index 0000000..b8da910 --- /dev/null +++ b/.github/workflows/publish-rpm-on-release.yml @@ -0,0 +1,52 @@ +--- + +name: Publish RPMs and SRPMs on Release +on: + release: + types: [published] +jobs: + publish-rpm: + name: EL${{ matrix.el_version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + el_version: [8, 9, 10] + + container: + image: almalinux:${{ matrix.el_version }} + + steps: + - name: Install dependencies + run: | + dnf -y install rpmdevtools git + + - name: Checkout code + uses: actions/checkout@v6 + with: + set-safe-directory: true + persist-credentials: false + fetch-depth: 0 + + - name: Build RPMs + uses: ./.github/actions/build-rpm + + - name: Install GitHub CLI + run: | + dnf -y install 'dnf-command(config-manager)' + dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo + dnf -y install gh --repo gh-cli + + - name: Upload RPM as release asset + run: | + gh release upload ${{ github.event.release.tag_name }} $GITHUB_WORKSPACE/*.rpm --clobber + env: + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload SRPM as release asset + run: | + gh release upload ${{ github.event.release.tag_name }} $GITHUB_WORKSPACE/*.src.rpm --clobber + env: + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/self-build-rpm.yml b/.github/workflows/self-build-rpm.yml index 119dc51..0b9068b 100644 --- a/.github/workflows/self-build-rpm.yml +++ b/.github/workflows/self-build-rpm.yml @@ -31,10 +31,5 @@ jobs: persist-credentials: false fetch-depth: 0 - - name: Switch to branch to leave detached head state - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git checkout -b gha-build - - name: Build RPMs - run: ./scripts/git-rpm-tools + uses: ./.github/actions/build-rpm diff --git a/README.md b/README.md index 6e61047..555f302 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# git-rpm-tools v0.7 +# git-rpm-tools v0.8 An utility which aims to trivialize creating RPMs from an existing git repository. diff --git a/dist/git-rpm-tools.spec b/dist/git-rpm-tools.spec index 873ca12..629c731 100644 --- a/dist/git-rpm-tools.spec +++ b/dist/git-rpm-tools.spec @@ -1,5 +1,5 @@ Name: git-rpm-tools -Version: 0.7 +Version: 0.8 Release: 1%{?dist} Summary: RPM packaging helper for Git repos @@ -38,6 +38,12 @@ cp ./scripts/git-rpm-tools %{buildroot}/usr/local/bin /usr/local/bin/* %changelog +* Fri Mar 13 2026 Wlodek, Jakub - 0.8-1 +- Add failure condition on cases where repo is in detatched HEAD state +- Add failure condition if git archive command fails +- Add failure condition if rpm build fails +- Updates to github actions CI workflows + * Wed Aug 14 2024 Derbenev, Anton - 0.7-1 - Added an option to specify a custom source tarball name - Minor touch-ups to help message and options order diff --git a/scripts/git-rpm-tools b/scripts/git-rpm-tools index c3a9ac8..7948be8 100755 --- a/scripts/git-rpm-tools +++ b/scripts/git-rpm-tools @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERSION=0.6 +VERSION=0.8 BUILD_TREE="$PWD/rpmbuildtree" # Print warning message in stderr