changed dockerfile #24
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*.*.*' # Trigger the workflow when a new tag is pushed | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Free disk space to ensure there's enough room for Docker operations | |
- name: Free disk space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
# Set up Docker Buildx for building multi-stage Dockerfile | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
# Build the Docker image using the new multi-stage Dockerfile and run tests | |
- name: Build and test using Docker | |
run: | | |
docker buildx build --target test --load -t stone-prover-test . # Build and run the test stage | |
docker buildx build --target target --load -t stone-prover-prod . # Build the production image | |
docker create --name temp stone-prover-prod | |
docker cp temp:/usr/local/bin/cpu_air_prover ./cpu_air_prover | |
docker cp temp:/usr/local/bin/cpu_air_verifier ./cpu_air_verifier | |
docker rm temp | |
# Package the binaries into an RPM using Fedora | |
- name: Package RPM | |
run: | | |
docker run --rm -v $(pwd):/rpmbuild/SOURCES fedora:latest \ | |
bash -c "dnf install -y rpm-build && \ | |
mkdir -p /rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} && \ | |
cp /rpmbuild/SOURCES/stone-prover.spec /rpmbuild/SPECS/ && \ | |
rpmbuild -ba /rpmbuild/SPECS/stone-prover.spec \ | |
--define \"version ${GITHUB_REF#refs/tags/v}\" \ | |
--define \"_topdir /rpmbuild\"" | |
# Upload the generated RPM file to the GitHub release | |
- name: Upload RPM to GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ./RPMS/x86_64/*.rpm | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |