Skip to content

packaging: fix path (#5113) #5

packaging: fix path (#5113)

packaging: fix path (#5113) #5

---
name: Deploy to staging
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
version:
description: Version of Fluent Bit to build
required: true
default: master
target:
description: Only build a specific target, intended for debug/test/quick builds only.
required: false
default: ""
# We do not want a new staging build to run whilst we are releasing the current staging build.
# We also do not want multiples to run for the same version.
concurrency: staging-build-release
jobs:
# This job strips off the `v` at the start of any tag provided.
# It then provides this metadata for the other jobs to use.
staging-build-get-meta:
name: Get metadata to build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.formatted_version.outputs.replaced }}
steps:
- run: |
echo "Version: ${{ github.event.inputs.version || github.ref_name }}"
shell: bash
# This step is to consolidate the three different triggers into a single "version"
# 1. If manual dispatch - use the version provided.
# 2. If cron/regular build - use master.
# 3. If tag trigger, use that tag.
- name: Get the version
id: get_version
run: |
VERSION="${INPUT_VERSION}"
if [ -z "${VERSION}" ]; then
echo "Defaulting to master"
VERSION=master
fi
echo ::set-output name=VERSION::$VERSION
shell: bash
env:
# Use the dispatch variable in preference, if empty use the context ref_name which should
# only ever be a tag or the master branch for cron builds.
INPUT_VERSION: ${{ github.event.inputs.version || github.ref_name }}
# String the 'v' prefix for tags.
- uses: frabert/[email protected]
id: formatted_version
with:
pattern: '[v]*(.*)$'
string: "${{ steps.get_version.outputs.VERSION }}"
replace-with: '$1'
flags: 'g'
staging-build-images:
needs: staging-build-get-meta
uses: fluent/fluent-bit/.github/workflows/call-build-images.yaml@master
with:
version: ${{ needs.staging-build-get-meta.outputs.version }}
ref: ${{ github.event.inputs.version || github.ref_name }}
registry: ghcr.io
username: ${{ github.actor }}
image: ${{ github.repository }}/staging
environment: staging
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
cosign_private_key: ${{ secrets.COSIGN_PRIVATE_KEY }}
cosign_private_key_password: ${{ secrets.COSIGN_PASSWORD }}
staging-build-generate-schema:
needs:
- staging-build-get-meta
- staging-build-images
runs-on: ubuntu-latest
steps:
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: |
docker run --rm -it ${{ github.repository }}/staging:${{ needs.staging-build-get-meta.outputs.version }} -J > fluent-bit-schema-${{ needs.staging-build-get-meta.outputs.version }}.json
cat fluent-bit-schema-${{ needs.staging-build-get-meta.outputs.version }}.json | jq -M > fluent-bit-schema-pretty-${{ needs.staging-build-get-meta.outputs.version }}.json
shell: bash
- name: Upload the schema
uses: actions/upload-artifact@v2
with:
path: ./
name: fluent-bit-schema*.json
if-no-files-found: error
- name: Push schema to S3
run: |
aws --region "$AWS_REGION" s3 sync . "s3://${AWS_S3_BUCKET}/${DEST_DIR}" --no-progress ${ENDPOINT}
env:
DEST_DIR: "${{ needs.staging-build-get-meta.outputs.version }}/"
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_STAGING }}
staging-build-generate-matrix:
name: Staging build matrix
runs-on: ubuntu-latest
outputs:
build-matrix: ${{ steps.set-matrix.outputs.build-matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Set up the list of target to build so we can pass the JSON to the reusable job
- uses: ./.github/actions/generate-package-build-matrix
id: set-matrix
with:
target: ${{ github.event.inputs.target || '' }}
staging-build-packages:
needs: [ staging-build-get-meta, staging-build-generate-matrix ]
uses: fluent/fluent-bit/.github/workflows/call-build-packages.yaml@master

Check failure on line 133 in .github/workflows/staging-build.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/staging-build.yaml

Invalid workflow file

error parsing called workflow ".github/workflows/staging-build.yaml" -> "fluent/fluent-bit/.github/workflows/call-build-packages.yaml@master" : failed to fetch workflow: workflow was not found.
with:
version: ${{ needs.staging-build-get-meta.outputs.version }}
ref: ${{ github.event.inputs.version || github.ref_name }}
build_matrix: ${{ needs.staging-build-generate-matrix.outputs.build-matrix }}
environment: staging
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
bucket: ${{ secrets.AWS_S3_BUCKET_STAGING }}
access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_private_key_passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}