From dafffc769eae9ebce0d0699404467f78f218a9eb Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Sat, 22 Jul 2023 10:57:58 +0900 Subject: [PATCH] workflow: use DAG for release --- .github/workflows/build_release.yaml | 40 +++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_release.yaml b/.github/workflows/build_release.yaml index 6662d0d..6c08c27 100644 --- a/.github/workflows/build_release.yaml +++ b/.github/workflows/build_release.yaml @@ -49,8 +49,6 @@ jobs: run: docker create --name deb_make deb_make - name: Copy files run: 'docker cp deb_make:/deb/. deb/' - - name: Fix RELEASE.md version - run: sed -i 's|#{GIT_VERSION}|${{ env.GIT_VERSION }}|g' RELEASE.md - name: 'Release debian files' uses: ncipollo/release-action@v1 with: @@ -60,6 +58,42 @@ jobs: omitBodyDuringUpdate: true omitNameDuringUpdate: true updateOnlyUnreleased: true - prerelease: true + draft: true + + publish: + runs-on: ubuntu-latest + permissions: + contents: write + needs: [build] + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + - name: Set GIT_VERSION + shell: bash + run: | + majorVer=$(cat VERSION) + lastVer=$(git tag --sort version:refname --list "v$majorVer.*" | tail -n1) + if [[ -n "$lastVer" ]]; then + newVer=(${lastVer//./ }) + newVer[-1]="$((${newVer[-1]}+1))" + nextVer="${newVer[*]}" + nextVer="${nextVer// /.}" + else + nextVer="v$majorVer.0" + fi + echo "MajorVer=$majorVer LastVer=$lastVer NextVer=$nextVer" + echo "GIT_VERSION=${nextVer//v/}" >> $GITHUB_ENV + - name: Fix RELEASE.md version + run: sed -i 's|#{GIT_VERSION}|${{ env.GIT_VERSION }}|g' RELEASE.md + - name: 'Release debian files' + uses: ncipollo/release-action@v1 + with: + tag: "v${{ env.GIT_VERSION }}" + allowUpdates: true + updateOnlyUnreleased: true generateReleaseNotes: true + prerelease: true bodyFile: RELEASE.md