mirror of https://github.com/statping/statping
move is_release, is_stable and is_unstable to data job
once again, having this in one place is nicepull/1118/head
parent
5655592864
commit
dd3508de9d
|
@ -8,19 +8,6 @@ on:
|
||||||
# paths-ignore:
|
# paths-ignore:
|
||||||
# - "**.md"
|
# - "**.md"
|
||||||
|
|
||||||
env:
|
|
||||||
is_stable: |
|
|
||||||
github.event_name == 'push'
|
|
||||||
&& github.ref == 'refs/heads/stable'
|
|
||||||
is_unstable: |
|
|
||||||
github.event_name == 'push'
|
|
||||||
&& github.ref == 'refs/heads/unstable'
|
|
||||||
# this is an alias for is-stable || is-unstable
|
|
||||||
is_release: |
|
|
||||||
github.event_name == 'push'
|
|
||||||
&& (github.ref == 'refs/heads/stable'
|
|
||||||
|| github.ref == 'refs/heads/unstable')
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
data:
|
data:
|
||||||
# this job collects general variables and inputs for later use.
|
# this job collects general variables and inputs for later use.
|
||||||
|
@ -29,11 +16,20 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.version.outputs.version }}
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
is_release: ${{ steps.states.outputs.is_release }}
|
||||||
|
is_stable: ${{ steps.states.outputs.is_stable }}
|
||||||
|
is_unstable: ${{ steps.states.outputs.is_unstable }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: get version
|
- name: get version
|
||||||
id: version
|
id: version
|
||||||
run: echo "::set-output name=version::$(cat version.txt)"
|
run: echo "::set-output name=version::$(cat version.txt)"
|
||||||
|
- name: get stable/unstable states
|
||||||
|
id: states
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=is_release::${{ github.event_name == 'push' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/unstable') }}"
|
||||||
|
echo "::set-output name=is_stable::${{ github.event_name == 'push' && github.ref == 'refs/heads/stable' }}"
|
||||||
|
echo "::set-output name=is_unstable::${{ github.event_name == 'push' && github.ref == 'refs/heads/unstable' }}"
|
||||||
frontend:
|
frontend:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: data
|
needs: data
|
||||||
|
@ -474,14 +470,9 @@ jobs:
|
||||||
|
|
||||||
# all other release jobs should be based on this
|
# all other release jobs should be based on this
|
||||||
release-precondition-check:
|
release-precondition-check:
|
||||||
# only run release jobs on push to stable/unstable
|
# only run release jobs on push to stable/unstable.
|
||||||
# sadly, you can't use ${{ env.is_release }} here
|
# yes, we need to explicitly compare to 'true' here since it's a string
|
||||||
if: |
|
if: ${{ success() && needs.data.outputs.is_release == 'true' }}
|
||||||
success() && (
|
|
||||||
github.event_name == 'push'
|
|
||||||
&& (github.ref == 'refs/heads/stable'
|
|
||||||
|| github.ref == 'refs/heads/unstable')
|
|
||||||
)
|
|
||||||
needs: [ data, build, test-postman-sqlite, test-postman-mysql, test-postman-postgres ]
|
needs: [ data, build, test-postman-sqlite, test-postman-mysql, test-postman-postgres ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -510,7 +501,7 @@ jobs:
|
||||||
VERSION: ${{ needs.data.outputs.version }}
|
VERSION: ${{ needs.data.outputs.version }}
|
||||||
with:
|
with:
|
||||||
# add "dev-" prefix for unstable releases
|
# add "dev-" prefix for unstable releases
|
||||||
tag_name: ${{ env.is_unstable && 'dev-' || '' }}v${{ needs.data.outputs.version }}
|
tag_name: ${{ needs.data.outputs.is_unstable && 'dev-' || '' }}v${{ needs.data.outputs.version }}
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: files/statping-*
|
files: files/statping-*
|
||||||
|
|
Loading…
Reference in New Issue