From e7a3663e4cd78d6fd1524974a552e977247b4728 Mon Sep 17 00:00:00 2001 From: pyrco <105293448+pyrco@users.noreply.github.com> Date: Tue, 8 Oct 2024 08:58:45 +0200 Subject: [PATCH] Fix the propagation of the APP_VERSION variable between workflow jobs --- .github/workflows/ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1470fce..6e4d481 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,14 @@ on: jobs: build: runs-on: ubuntu-latest + outputs: + app-version: ${{ steps.app-version.outputs.APP_VERSION }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + - id: app-version + run: echo "APP_VERSION=$(git describe --tags 2>/dev/null || echo "0.0.0")" >> $GITHUB_OUTPUT - run: | mkdir -p build cp -r dissect_addon build/dissect_addon @@ -27,6 +31,8 @@ jobs: build-lint: needs: build runs-on: ubuntu-latest + env: + APP_VERSION: ${{ needs.build.ouputs.app-version }} steps: - uses: actions/download-artifact@v4 with: @@ -43,6 +49,8 @@ jobs: if: ${{ github.ref_name == 'main' || github.ref_type == 'tag' }} needs: build-lint runs-on: ubuntu-latest + env: + APP_VERSION: ${{ needs.build.ouputs.app-version }} steps: - uses: actions/download-artifact@v4 with: @@ -51,7 +59,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.9" - - run: echo "APP_VERSION=$(git describe --tags 2>/dev/null || echo "0.0.0")" >> $GITHUB_ENV - run: | sed -i -E "s/version = (.*)/version = $APP_VERSION/g" build/dissect_addon/default/app.conf pip install splunk-packaging-toolkit @@ -66,6 +73,8 @@ jobs: release-lint: needs: release runs-on: ubuntu-latest + env: + APP_VERSION: ${{ needs.build.ouputs.app-version }} steps: - uses: actions/download-artifact@v4 with: @@ -88,6 +97,8 @@ jobs: if: github.ref_type == 'tag' needs: release-lint runs-on: ubuntu-latest + env: + APP_VERSION: ${{ needs.build.ouputs.app-version }} steps: - uses: actions/download-artifact@v4 with: