.github/workflows/build.yml #52
Workflow file for this run
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
on: | ||
workflow_dispatch: | ||
jobs: | ||
env: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: VKCOM/statshouse | ||
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 }} | ||
front: | ||
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: | | ||
REACT_APP_BUILD_VERSION=${{needs.env.outputs.version}}-${{needs.env.outputs.timestamp}} | ||
make build-sh-ui | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: statshouse-${{needs.env.outputs.version}}-ui | ||
path: | | ||
statshouse-ui/build | ||
.dummy_preserves_directory_structure | ||
- run: make build-grafana-ui | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: statshouse-${{needs.env.outputs.version}}-ui | ||
path: | | ||
grafana-plugin-ui/dist | ||
.dummy_preserves_directory_structure | ||
debian: | ||
if: ${{ false }} # disable | ||
strategy: | ||
matrix: | ||
release: [buster, bullseye] | ||
needs: [env, front] | ||
uses: ./.github/workflows/build_deb.yml | ||
with: | ||
ref: ${{needs.env.outputs.ref}} | ||
ref_timestamp: ${{needs.env.outputs.ref_timestamp}} | ||
timestamp: ${{needs.env.outputs.timestamp}} | ||
version: ${{needs.env.outputs.version}} | ||
container: '{"image": "golang:1.19-${{matrix.release}}"}' | ||
name: 'debian' | ||
release: ${{matrix.release}} | ||
secrets: inherit | ||
ubuntu_jammy: | ||
if: ${{ false }} # disable | ||
needs: [env, front] | ||
uses: ./.github/workflows/build_deb.yml | ||
with: | ||
ref: ${{needs.env.outputs.ref}} | ||
ref_timestamp: ${{needs.env.outputs.ref_timestamp}} | ||
timestamp: ${{needs.env.outputs.timestamp}} | ||
version: ${{needs.env.outputs.version}} | ||
name: ubuntu | ||
release: jammy | ||
runs-on: ubuntu-22.04 | ||
secrets: inherit | ||
ubuntu_focal: | ||
if: ${{ false }} # disable | ||
needs: [env, front] | ||
uses: ./.github/workflows/build_deb.yml | ||
with: | ||
ref: ${{needs.env.outputs.ref}} | ||
ref_timestamp: ${{needs.env.outputs.ref_timestamp}} | ||
timestamp: ${{needs.env.outputs.timestamp}} | ||
version: ${{needs.env.outputs.version}} | ||
runs-on: ubuntu-20.04 | ||
name: ubuntu | ||
release: focal | ||
secrets: inherit | ||
almalinux: | ||
uses: ./.github/workflows/build_rpm.yml | ||
with: | ||
ref: ${{needs.env.outputs.ref}} | ||
ref_timestamp: ${{needs.env.outputs.ref_timestamp}} | ||
timestamp: ${{needs.env.outputs.timestamp}} | ||
version: ${{needs.env.outputs.version}} | ||
name: almalinux | ||
release: 9.2 | ||
secrets: inherit | ||
draft_release: | ||
if: ${{ false }} # disable | ||
needs: [env, debian, ubuntu_jammy, ubuntu_focal] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: VKCOM/statshouse | ||
fetch-depth: 0 | ||
- uses: actions/download-artifact@master | ||
with: | ||
name: statshouse-${{needs.env.outputs.version}}_amd64-deb | ||
- run: gh release create --draft --generate-notes --title "Release ${{needs.env.outputs.version}}" $(find -type f -name *.deb) | ||
env: | ||
GITHUB_TOKEN: ${{secrets.DEVTOOLS_GITHUB_TOKEN}} |