Skip to content

Commit

Permalink
Propagate step outputs to the job level in release CI (model-checking…
Browse files Browse the repository at this point in the history
…#1140)

* Propagate step outputs to the job level in release CI

* Move output to where the env var is properly set
  • Loading branch information
tedinski authored May 2, 2022
1 parent 2e458cc commit aa91ce4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down Expand Up @@ -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

0 comments on commit aa91ce4

Please sign in to comment.