Skip to content

Commit

Permalink
CI: prepare spec file only in the last stage
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Jun 3, 2024
1 parent 892eb05 commit 5ad14f6
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,27 @@ jobs:
repository: ${{ inputs.repo }}/reva
path: reva
ref: ${{ inputs.branch }}
- name: Bump version in spec file
run: |
export GOPATH=$(pwd)/go
export PATH=$PATH:$GOPATH/bin
cd reva
export REVAVER="Reva commit $(git rev-parse --short HEAD) at ${{ inputs.repo }}/${{ inputs.branch }}"
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
echo "Reva version is "\""$REVAVER"\"
- 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:
revaVer: ${{ steps.reva-rpms.outputs.revaVer }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
Expand All @@ -88,6 +82,8 @@ jobs:
permissions:
contents: write
container: golang:1.20
env:
REVAVER: ${{ needs.build.outputs.revaVer }}
steps:
- name: Checkout release repository
uses: actions/checkout@v3
Expand All @@ -97,8 +93,9 @@ jobs:
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]"
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
Expand Down

0 comments on commit 5ad14f6

Please sign in to comment.