attach dev builds all into one release

Requirements:
- there exists a tag named `latest-dev` already
- there exists a release on that tag
This commit is contained in:
Robin C. Ladiges 2022-08-13 21:17:11 +02:00
parent aff422a6e0
commit 2898a762d4
No known key found for this signature in database
GPG key ID: B494D3DF92661B99
3 changed files with 69 additions and 1 deletions

View file

@ -6,6 +6,10 @@ inputs:
description : 'version tag' description : 'version tag'
required : false required : false
default : '' default : ''
prefix:
description : 'filename prefix'
required : false
default : ''
outputs: outputs:
@ -24,7 +28,7 @@ runs:
run: | run: |
VERS=${{ inputs.tag }} VERS=${{ inputs.tag }}
echo "::set-output name=version::${VERS:1}" echo "::set-output name=version::${VERS:1}"
echo "::set-output name=filename::SMO_Online${{ (inputs.tag != '' && format('_{0}', inputs.tag)) || '' }}" echo "::set-output name=filename::${{ inputs.prefix }}SMO_Online${{ (inputs.tag != '' && format('_{0}', inputs.tag)) || '' }}"
- -
name : Set up Docker Buildx name : Set up Docker Buildx
uses : docker/setup-buildx-action@v2 uses : docker/setup-buildx-action@v2

View file

@ -5,11 +5,13 @@ on:
push: push:
branches: branches:
- '**' - '**'
- '!dev'
tags: tags:
- '**' - '**'
- '!v[0-9]+.[0-9]+.[0-9]+' - '!v[0-9]+.[0-9]+.[0-9]+'
- '!v[0-9]+.[0-9]+.[0-9]+\+*' - '!v[0-9]+.[0-9]+.[0-9]+\+*'
- '!v[0-9]+.[0-9]+.[0-9]+-*' - '!v[0-9]+.[0-9]+.[0-9]+-*'
- '!latest-dev'
pull_request: pull_request:
branches: branches:
- '**' - '**'

62
.github/workflows/dev-release.yml vendored Normal file
View file

@ -0,0 +1,62 @@
name: Dev Release
on:
push:
branches:
- 'dev'
env:
TAG : 'latest-dev'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
outputs:
filename: ${{ steps.build.outputs.filename }}
steps:
-
name : Checkout
uses : actions/checkout@v3
-
name : Environment
id : env
shell : bash
run: |
echo "::set-output name=prefix::$(date +'%Y%m%d_%H%M%S_' --utc)"
-
name : Build artifacts
id : build
uses : ./.github/actions/build
with:
prefix : ${{ steps.env.outputs.prefix }}
attach:
needs: build
runs-on: ubuntu-latest
steps:
-
name : Checkout
uses : actions/checkout@v3
-
name : Get release info
id : release
shell : bash
run: |
url=`curl -sS --fail ${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/${{ env.TAG }} | jq .upload_url -r`
echo "::set-output name=upload_url::$url"
-
name : Attach build artifacts to release
uses : ./.github/actions/attach
with:
filename : ${{ needs.build.outputs.filename }}
upload_url : ${{ steps.release.outputs.upload_url }}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}