Skip to content

Commit

Permalink
Move version extraction part into create-release job
Browse files Browse the repository at this point in the history
* Since windows does not support varaible substitution
* And also fix bug when creating Release page
  • Loading branch information
joemphilips committed Apr 12, 2020
1 parent a5f80df commit 62b5374
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,29 @@ jobs:
id: get_version
run: |
echo ${GITHUB_REF/refs\/tags\/v/}
echo ${GITHUB_REF/refs\/tags\/v/} > version.txt
echo "::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.VERSION }}
release_name: Release v${{ steps.get_versoin.outputs.VERSION }}
release_name: Release v${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: true # TODO: change to false when ready

- run: |
echo '${{ steps.create_release.outputs.upload_url }}' > release_upload_url.txt
- uses: actions/upload-artifact@v1
with:
name: create-release
path: release_upload_url.txt
- uses: actions/upload-artifact@v1
with:
name: get_version
path: version.txt

pack_and_push:
needs: create_release
Expand All @@ -46,14 +51,6 @@ jobs:
with:
submodules: recursive

# workaround for upload-release-asset does not support variable expansion.
# see: https://github.com/actions/upload-release-asset/issues/17
- name: get version
id: get_version
run: |
echo ${GITHUB_REF/refs\/tags\/v/}
echo "::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}"
- name: Setup 3.1.200 .NET Core
uses: actions/setup-dotnet@v1
with:
Expand All @@ -74,12 +71,19 @@ jobs:
run: |
dotnet pack -p:Configuration=Release src/NRustLightning
# get and set release url and version
- uses: actions/download-artifact@v1
with:
name: create-release
- uses: actions/download-artifact@v1
with:
name: get_version
- id: upload-url
run: |
echo "::set-output name=url::$(cat create-release/release_upload_url.txt)"
- id: get_version
run: |
echo "::set-output name=VERSION::$(cat get_version/version.txt)"
- name: upload release asset
uses: actions/upload-release-asset@v1
Expand Down

0 comments on commit 62b5374

Please sign in to comment.