Skip to content

Build and release

Build and release #84

Workflow file for this run

name: Build and release
on:
workflow_dispatch:
inputs:
repo:
description: 'Reva repository to be used'
required: true
default: 'cs3org'
branch:
description: 'Branch to be built'
required: true
default: 'master'
go-version:
description: 'Go version'
required: true
default: '1.21.3'
jobs:
build:
name: Release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container: [cern/alma8-base, cern/alma9-base]
permissions:
contents: write
container: ${{ matrix.container }}
steps:
- name: Checkout release repository
uses: actions/checkout@v3
with:
path: reva-release
- name: Install build infrastructure
run: |
source /etc/os-release
OSMAJ="$(echo $VERSION_ID | cut -c1)"
cat reva-release/ceph.repo.in | sed "s/OSMAJOR/$OSMAJ/" > /etc/yum.repos.d/ceph.repo
[[ $OSMAJ -eq "7" ]] && sed -i "s/quincy/octopus/" /etc/yum.repos.d/ceph.repo && cp reva-release/endpoint.repo /etc/yum.repos.d/endpoint.repo && yum -y install yum-plugin-priorities && sed -i '/RemovePathPostfixes.*/d' reva-release/cernbox-revad.spec && echo "CI: adapted setup to CC7, installing related dependencies"
yum install -y git wget make gcc gcc-c++ rpm-build glibc-static libcephfs-devel librbd-devel librados-devel
- name: Install golang
run: |
wget https://go.dev/dl/go${{ inputs.go-version }}.linux-amd64.tar.gz && tar xfz go${{ inputs.go-version }}.linux-amd64.tar.gz
- name: Checkout reva repository
uses: actions/checkout@v3
with:
repository: ${{ inputs.repo }}/reva
path: reva
ref: ${{ inputs.branch }}
- name: Copy necessary files for building the RPMs
run: |
cp reva-release/Makefile reva/Makefile.rpm
cp reva-release/cernbox-revad.spec reva/cernbox-revad.spec
- name: Create reva RPMs
id: reva-rpms
run: |
set -x
export GOPATH=$(pwd)/go
export PATH=$PATH:$GOPATH/bin
rm -rf ~/.cache/go-build
cd reva
echo revaVer="Reva commit $(git rev-parse --short HEAD) at ${{ inputs.repo }}/${{ inputs.branch }}" >> "$GITHUB_OUTPUT"
make -f Makefile.rpm rpm
mkdir /release
mv cernbox-*.rpm /release
env:
CGO_ENABLED: 1
CONTAINER: ${{ matrix.container }}
outputs:

Check failure on line 70 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Build and release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 70, Col: 9): Unexpected value 'outputs'
revaVer: ${{ steps.reva-rpms.outputs.revaVer }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: cernbox-rpms
path: /release
retention-days: 1
reporelease:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
container: golang:1.20
env:
REVAVER: ${{ needs.build.outputs.revaVer }}
steps:
- name: Checkout release repository
uses: actions/checkout@v3
with:
path: reva-release
- name: Bump version in spec file
run: |
export GOPATH=$(pwd)/go
export PATH=$PATH:$GOPATH/bin
echo "Reva version was '$REVAVER'"
cd reva-release
go run prepare_release.go -author "cernbox-admins[bot]" -email "[email protected]" -reva-version "${REVAVER}"
echo "version=$(awk '$1 == "Version:" {print $2}' cernbox-revad.spec)" >> $GITHUB_ENV
- name: Push version
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: reva-release
commit_message: "Version ${{ env.version }}"
file_pattern: cernbox-revad.spec
commit_user_name: CERNBox Admins Bot
commit_user_email: [email protected]
tagging_message: v${{ env.version }}
- name: Download artifacts
id: download
uses: actions/download-artifact@v3
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
files: ${{ steps.download.outputs.download-path }}/cernbox-rpms/*
name: Version ${{ env.version }}
tag_name: v${{ env.version }}