Only attempt a starcatcher upload if the relevant repo secrets are present
Also get rid of the release_url hack.
This commit is contained in:
parent
5ec8baa406
commit
1a06f5ba48
2
.github/get-release-info.sh
vendored
2
.github/get-release-info.sh
vendored
@ -1,2 +0,0 @@
|
|||||||
value=`cat release_url/release_url.txt`
|
|
||||||
echo ::set-output name=upload_url::$value
|
|
5
.github/starcatcher-check.sh
vendored
Executable file
5
.github/starcatcher-check.sh
vendored
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
if [ ! -z "$STARCATCHER_PUBLISH_HOSTPORT" ]; then
|
||||||
|
echo ::set-output name=can_publish::yes
|
||||||
|
else
|
||||||
|
echo ::set-output name=can_publish::no
|
||||||
|
fi
|
29
.github/workflows/build.yaml
vendored
29
.github/workflows/build.yaml
vendored
@ -14,6 +14,9 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
can_publish: ${{ steps.starcatcher_check.outputs.can_publish }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
@ -31,11 +34,11 @@ jobs:
|
|||||||
release_name: ${{ steps.get_type.outputs.NAME }}
|
release_name: ${{ steps.get_type.outputs.NAME }}
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: false
|
prerelease: false
|
||||||
- run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
|
- id: starcatcher_check
|
||||||
- uses: actions/upload-artifact@v1
|
if: steps.get_type.outputs.TYPE != 'dev'
|
||||||
with:
|
run: bash -c './.github/starcatcher-check.sh'
|
||||||
name: release_url
|
env:
|
||||||
path: release_url.txt
|
STARCATCHER_PUBLISH_HOSTPORT: ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: [release]
|
needs: [release]
|
||||||
@ -91,12 +94,6 @@ jobs:
|
|||||||
python-version: '3.8'
|
python-version: '3.8'
|
||||||
- id: get_type
|
- id: get_type
|
||||||
run: python3 ./.github/get-type.py ${{ github.ref }}
|
run: python3 ./.github/get-type.py ${{ github.ref }}
|
||||||
- uses: actions/download-artifact@v1
|
|
||||||
with:
|
|
||||||
name: release_url
|
|
||||||
- id: get_release_info
|
|
||||||
if: steps.get_type.outputs.TYPE != 'dev'
|
|
||||||
run: bash -c "./.github/get-release-info.sh" ## gg github, this is terrible
|
|
||||||
- if: matrix.platform_short == 'mac'
|
- if: matrix.platform_short == 'mac'
|
||||||
uses: Homebrew/actions/setup-homebrew@master
|
uses: Homebrew/actions/setup-homebrew@master
|
||||||
- if: matrix.platform_short == 'mac'
|
- if: matrix.platform_short == 'mac'
|
||||||
@ -120,7 +117,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
|
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
asset_path: powder${{ matrix.suffix }}
|
asset_path: powder${{ matrix.suffix }}
|
||||||
asset_name: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
|
asset_name: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
@ -131,8 +128,8 @@ jobs:
|
|||||||
name: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
|
name: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
|
||||||
starcatcher-upload:
|
starcatcher-upload:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build]
|
needs: [build, release]
|
||||||
if: startsWith(github.ref, 'refs/tags/') # not a perfect match but get-type.py takes care of this in job build
|
if: needs.release.outputs.can_publish == 'yes' && startsWith(github.ref, 'refs/tags/') # not a perfect match but get-type.py takes care of this in job build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
#########################################################
|
#########################################################
|
||||||
@ -185,8 +182,8 @@ jobs:
|
|||||||
STARCATCHER_PUBLISH_FILENAME: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
|
STARCATCHER_PUBLISH_FILENAME: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
|
||||||
starcatcher-release:
|
starcatcher-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [starcatcher-upload]
|
needs: [starcatcher-upload, release]
|
||||||
if: startsWith(github.ref, 'refs/tags/') # not a perfect match but get-type.py takes care of this in job build
|
if: needs.release.outputs.can_publish == 'yes' && startsWith(github.ref, 'refs/tags/') # not a perfect match but get-type.py takes care of this in job build
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
|
Reference in New Issue
Block a user