Merge pull request #32 from Istador/dev-releases

Automatically attach dev builds into one common release
This commit is contained in:
CraftyBoss 2022-08-13 14:33:17 -07:00 committed by GitHub
commit d4df8f030c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 89 additions and 2 deletions

View File

@ -6,6 +6,10 @@ inputs:
description : 'version tag'
required : false
default : ''
prefix:
description : 'filename prefix'
required : false
default : ''
outputs:
@ -24,7 +28,7 @@ runs:
run: |
VERS=${{ inputs.tag }}
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
uses : docker/setup-buildx-action@v2

View File

@ -30,7 +30,7 @@ runs:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
with:
tag_name : ${{ inputs.tag }}
release_name : Release ${{ inputs.tag }}
release_name : ${{ inputs.tag }}
body : ''
draft : true
prerelease : false

View File

@ -5,9 +5,13 @@ on:
push:
branches:
- '**'
- '!dev'
tags:
- '**'
- '!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:
branches:
- '**'

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

@ -0,0 +1,77 @@
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 }}
move:
needs: attach
runs-on: ubuntu-latest
steps:
-
name : Checkout
uses : actions/checkout@v3
-
name : Move ${{ env.TAG }} tag
shell : bash
run: |
git config user.email "${{ github.actor }}@users.noreply.github.com"
git tag -f ${{ env.TAG }}
git push --force origin ${{ env.TAG }}

View File

@ -5,6 +5,8 @@ on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+\+*'
- 'v[0-9]+.[0-9]+.[0-9]+-*'
jobs: