From aa91ce4ff25baa82ed2af0fcf801edc43d4f659b Mon Sep 17 00:00:00 2001 From: Ted Kaminski Date: Mon, 2 May 2022 14:39:37 -0500 Subject: [PATCH] Propagate step outputs to the job level in release CI (#1140) * Propagate step outputs to the job level in release CI * Move output to where the env var is properly set --- .github/workflows/release.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0942673620ec..6d0508ef93fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,9 @@ jobs: runs-on: ubuntu-20.04 permissions: contents: write + outputs: + version: ${{ steps.versioning.outputs.version }} + upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - name: Checkout code uses: actions/checkout@v2 @@ -22,16 +25,20 @@ jobs: echo "CRATE_VERSION=$(cargo pkgid | cut -d: -f3)" >> $GITHUB_ENV # GITHUB_REF is refs/tags/kani-0.1.0 echo "TAG_VERSION=$(echo ${{ github.ref }} | cut -d "-" -f 2)" >> $GITHUB_ENV - # Output for upload scripts to see - echo ::set-output name=version::$TAG_VERSION + # Note that the above env vars get set for future steps, not this one - name: Version Check + id: versioning run: | + # Output for upload scripts to see + echo ::set-output name=version::${{ env.TAG_VERSION }} + # Validate git tag & Cargo.toml are in sync on version number if [[ ${{ env.CRATE_VERSION }} != ${{ env.TAG_VERSION }} ]]; then echo "Git tag ${{env.TAG_VERSION}} did not match crate version ${{env.CRATE_VERSION}}" exit 1 fi - name: Create release + id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -79,4 +86,3 @@ jobs: asset_path: kani-${{ needs.Release.outputs.version }}-${{ matrix.target }}.tar.gz asset_name: kani-${{ needs.Release.outputs.version }}-${{ matrix.target }}.tar.gz asset_content_type: application/gzip -