Skip to content

Commit

Permalink
We need the version step in the check job
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed May 11, 2021
1 parent b3bdfdc commit 8fd612f
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,23 @@ jobs:
echo ::set-output name=release::true
echo ::set-output name=prerelease::true
fi
- name: Set version
if: ${{github.head_ref == ''}}
id: version
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "main" ] && VERSION=latest
echo VERSION=$VERSION
echo "::set-output name=version::$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Dump state
run: |
echo "Tag/version: ${VERSION} / ${{needs.check.outputs.version}}"
echo "Should we publish artifacts? - do-publish = ${{needs.check.outputs.do-publish}}"
echo "Release? - release = ${{needs.check.outputs.release}}"
echo "Pre-release? - prerelease = ${{needs.check.outputs.prerelease}}"
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
Expand Down Expand Up @@ -75,20 +86,6 @@ jobs:
VERSION: ${{needs.check.outputs.version}}

steps:

- name: Set version
id: version
shell: bash
run: |
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
VERSION=$(echo $VERSION | sed -e 's/^v//')
else
VERSION=latest
fi
echo VERSION=$VERSION
echo "::set-output name=version::$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Install build tools
if: ${{ matrix.os == 'ubuntu-18.04' }}
run: |
Expand Down

0 comments on commit 8fd612f

Please sign in to comment.