Update Fedora packaging workflow and scripts #20
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: Release Fedora Package | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Fedora container and RPM | |
run: | | |
docker build -t fedora-build -f- . <<EOF | |
FROM fedora:latest | |
RUN dnf update -y && dnf install -y rpm-build gcc gcc-c++ make python3-pip wget git | |
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64 && \ | |
chmod +x bazelisk-linux-amd64 && \ | |
mv bazelisk-linux-amd64 /usr/local/bin/bazelisk | |
WORKDIR /build | |
COPY . . | |
RUN mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} | |
RUN cp stone-prover.spec ~/rpmbuild/SPECS/ | |
RUN VERSION=\$(echo ${GITHUB_REF#refs/tags/v}) && \ | |
rpmbuild -ba ~/rpmbuild/SPECS/stone-prover.spec --define "version \$VERSION" --define "_topdir \$HOME/rpmbuild" | |
EOF | |
- name: Copy RPM from container | |
run: | | |
docker create --name temp fedora-build | |
docker cp temp:/root/rpmbuild/RPMS/x86_64 ./rpms | |
docker rm temp | |
- name: Upload RPM to GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ./rpms/*.rpm | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |