Build and release #33
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: Build and release | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch of the cernbox/reva repository' | |
required: true | |
default: 'cernbox' | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
container: golang:1.20 | |
steps: | |
- name: Checkout release repository | |
uses: actions/checkout@v3 | |
with: | |
path: reva-release | |
- name: Bump version in spec file | |
run: | | |
cd reva-release | |
go run prepare_release.go -author "cernbox-admins[bot]" -email "cernbox-admins@cern.ch" | |
echo "version=$(awk '$1 == "Version:" {print $2}' revad.spec)" >> $GITHUB_ENV | |
- name: Checkout reva repository | |
uses: actions/checkout@v3 | |
with: | |
repository: cernbox/reva | |
path: reva | |
ref: ${{ inputs.branch }} | |
- name: Copy necessary files for building the RPM | |
run: | | |
cp reva-release/Makefile reva/Makefile.rpm | |
cp reva-release/revad.spec reva/revad.spec | |
- name: Create reva RPM | |
run: | | |
mkdir release | |
apt update && apt install -y rpm | |
cd reva | |
make -f Makefile.rpm rpm | |
cp revad-${{ env.version }}-1.x86_64.rpm ../release/revad-${{ env.version }}.rpm | |
env: | |
CGO_ENABLED: 1 | |
STATIC: 1 | |
- name: Push version | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
repository: reva-release | |
commit_message: "Version ${{ env.version }}" | |
file_pattern: revad.spec | |
commit_user_name: CERNBox Admins Bot | |
commit_user_email: cernbox-admins@cern.ch | |
tagging_message: v${{ env.version }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: false | |
prerelease: false | |
files: release/revad-${{ env.version }}.rpm | |
name: Version ${{ env.version }} | |
tag_name: v${{ env.version }} |