Skip to content

.github/workflows/build.yml #155

.github/workflows/build.yml

.github/workflows/build.yml #155

Workflow file for this run

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to build'
required: true
draft_release:
description: 'Draft a release'
required: false
default: true
jobs:
env:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: VKCOM/statshouse
ref: ${{ github.event.inputs.tag }}
fetch-depth: 0
- id: main
run: |
BUILD_COMMIT=$(git log --format="%H" -n 1)
BUILD_COMMIT_TS=$(git log --format="%ct" -n 1)
BUILD_TIME=$(date +%FT%T%z)
BUILD_VERSION=$(git describe --tags --always --dirty)
BUILD_VERSION=${BUILD_VERSION#v}
echo "BUILD_COMMIT=$BUILD_COMMIT" >> "$GITHUB_OUTPUT"
echo "BUILD_COMMIT_TS=$BUILD_COMMIT_TS" >> "$GITHUB_OUTPUT"
echo "BUILD_TIME=$BUILD_TIME" >> "$GITHUB_OUTPUT"
echo "BUILD_VERSION=$BUILD_VERSION" >> "$GITHUB_OUTPUT"
outputs:
ref: ${{ steps.main.outputs.BUILD_COMMIT }}
ref_timestamp: ${{ steps.main.outputs.BUILD_COMMIT_TS }}
timestamp: ${{ steps.main.outputs.BUILD_TIME }}
version: ${{ steps.main.outputs.BUILD_VERSION }}
frontend:
needs: env
runs-on: ubuntu-latest
container:
image: node:18
steps:
- uses: actions/checkout@v4
with:
repository: VKCOM/statshouse
ref: ${{needs.env.outputs.ref}}
fetch-depth: 0
- run: echo "REACT_APP_BUILD_VERSION=${{needs.env.outputs.version}}-${{needs.env.outputs.timestamp}}" >> $GITHUB_ENV
- run: make build-sh-ui
- uses: actions/upload-artifact@v4
with:
name: statshouse-ui-${{needs.env.outputs.version}}
path: |
statshouse-ui/build
.dummy_preserves_directory_structure
outputs:
artifact: statshouse-ui-${{needs.env.outputs.version}}
rpm:
strategy:
matrix:
image: ["centos:centos7", "almalinux:9"]
needs: [env, frontend]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: VKCOM/statshouse
ref: ${{needs.env.outputs.ref}}
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: ${{needs.frontend.outputs.artifact}}
- run: echo "BUILD_VERSION=`echo ${{needs.env.outputs.version}} | sed -e 's:-:.:g'`" >> $GITHUB_ENV
- run: build/makerpm.sh ${{matrix.image}}
- uses: actions/upload-artifact@v4
with:
name: statshouse-pkg-rpm-${{needs.env.outputs.version}}-${{strategy.job-index}}
path: RPMS/*.rpm
deb:
needs: [env, frontend]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: VKCOM/statshouse
ref: ${{needs.env.outputs.ref}}
fetch-depth: 0
- run: build/make-pkg.sh debian-bullseye
- run: build/make-pkg.sh debian-bookworm
- run: build/make-pkg.sh ubuntu-focal
- run: build/make-pkg.sh ubuntu-jammy
- uses: actions/upload-artifact@v4
with:
name: statshouse-pkg-debian-bullseye-${{inputs.version}}-${{github.run_number}}
path: target/debian-bullseye/*.deb
- uses: actions/upload-artifact@v4
with:
name: statshouse-pkg-debian-bookworm-${{inputs.version}}-${{github.run_number}}
path: target/debian-bookworm/*.deb
- uses: actions/upload-artifact@v4
with:
name: statshouse-pkg-ubuntu-focal-${{inputs.version}}-${{github.run_number}}
path: target/ubuntu-focal/*.deb
- uses: actions/upload-artifact@v4
with:
name: statshouse-pkg-ubuntu-jammy-${{inputs.version}}-${{github.run_number}}
path: target/ubuntu-jammy/*.deb
draft_release:
if: ${{ github.event.inputs.draft_release }}
needs: [env, rpm, ubuntu, debian]

Check failure on line 109 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build.yml

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 109, Col: 23): Job 'draft_release' depends on unknown job 'ubuntu'. .github/workflows/build.yml (Line: 109, Col: 31): Job 'draft_release' depends on unknown job 'debian'.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: VKCOM/statshouse
ref: ${{needs.env.outputs.ref}}
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
pattern: statshouse-pkg-*
path: pkg/
- run: gh release create --draft --generate-notes --title "${{github.event.inputs.tag}}" ${{github.event.inputs.tag}} $(find ./pkg -type f -name *.deb -o -name *.rpm)
env:
GITHUB_TOKEN: ${{secrets.DEVTOOLS_GITHUB_TOKEN}}