Skip to content

Commit

Permalink
Fix the propagation of the APP_VERSION variable between workflow jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrco committed Oct 8, 2024
1 parent d133025 commit e7a3663
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit e7a3663

Please sign in to comment.