Skip to content

Debugging workflow bug #5

Debugging workflow bug

Debugging workflow bug #5

Workflow file for this run

# .github/workflows/build-release.yml
name: Build Release
on:
push:
tags:
- 'r[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64, aarch64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up variables
run: |
GIT_DATE=$(git -P log -1 --pretty=%cd --date=format:%Y%m%d)
GIT_HASH=$(git rev-parse --short HEAD)
TAG=${GITHUB_REF#refs/tags/}
RELEASE=${TAG#r}
echo GIT_DATE=$GIT_DATE >>$GITHUB_ENV
echo GIT_HASH=$GIT_HASH >>$GITHUB_ENV
echo RELEASE=$RELEASE >>$GITHUB_ENV
- name: Build the RPM package
run: ./build-rpm --define "git_date $GIT_DATE" --define "git_hash $GIT_HASH" --target ${{ matrix.arch }}
- name: Determine the name of the RPM package file
run: |
set -x
ls -la .
ls -la RPMS
ls -la RPMS/${{ matrix.arch }}
ls -la RPMS/${{ matrix.arch }}/confd-*.${GIT_DATE}git${GIT_HASH}.${{ matrix.arch }}.rpm
RPM_PATH=RPMS/${{ matrix.arch }}/confd-*.${GIT_DATE}git${GIT_HASH}.${{ matrix.arch }}.rpm
RPM_NAME=${RPM_PATH##*/}
tee -a $GITHUB_ENV <<<RPM_PATH=$RPM_PATH
tee -a $GITHUB_ENV <<<RPM_NAME=$RPM_NAME
- name: Upload `confd`
uses: actions/upload-artifact@v4
with:
name: ${{ env.RPM_NAME }}
path: ${{ env.RPM_PATH }}
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download `confd`
uses: actions/download-artifact@v4
with:
# Files will be downloaded to `release/$name/$name`
path: release
- name: Fix downloaded `confd` paths
working-directory: release
run: |
for d in */; do
mv -v "$d" tmp
mv -v tmp/* .
rm -frv tmp
done
- name: Create release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: release/*
# vim:set sw=2 ts=2 et: