From 62d5f30cf92d9a03c836ef51e3d196c6f1205351 Mon Sep 17 00:00:00 2001 From: Ryan Fischbach Date: Fri, 2 Feb 2024 11:08:22 -0800 Subject: [PATCH] gha: auto-release work. --- .github/workflows/tag-commit.yml | 3 ++- .github/workflows/tag-release.yml | 35 ++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tag-commit.yml b/.github/workflows/tag-commit.yml index 6262b5d0..c869a4a6 100644 --- a/.github/workflows/tag-commit.yml +++ b/.github/workflows/tag-commit.yml @@ -12,7 +12,8 @@ jobs: runs-on: ubuntu-latest outputs: VERSION_STR: ${{ steps.config_step.outputs.VERSION_STR }} - permissions: write-all + permissions: + contents: write steps: - name: "Create Version" id: config_step diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 9d1f7d7c..5dafa447 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -7,24 +7,35 @@ on: - master jobs: - create-release: + build_cfg: runs-on: ubuntu-latest + outputs: + VERSION_STR: ${{ steps.config_step.outputs.VERSION_STR }} + permissions: + contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: "Create Version" - id: version_cfg + - name: "Create Version STR" + id: config_step run: |- VER_BUILD=$(date +%-H%M) - VERSION_NUM="v$(date +%y).$(date +%-m).$(date +%-d)-${VER_BUILD:0:3}" - echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_OUTPUT + VERSION_STR="v$(date +%y).$(date +%-m).$(date +%-d)-${VER_BUILD:0:3}" + echo "VERSION_STR=${VERSION_STR}" >> $GITHUB_OUTPUT - - name: "Tag release" - uses: actions/create-release@v1 + - name: "Create Release" + uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ steps.version_cfg.outputs.VERSION_NUM }} - release_name: ${{ steps.version_cfg.outputs.VERSION_NUM }} - draft: false - prerelease: false + tag_name: ${{ steps.config_step.outputs.VERSION_STR }} + release_name: ${{ steps.config_step.outputs.VERSION_STR }} + generate_release_notes: true + + build_node_app: + needs: [build_cfg] + name: "Build node tarball with tag [${{ needs.build_cfg.outputs.VERSION_STR }}]" + uses: ./.github/workflows/util-build-node-app.yml + secrets: inherit + with: + version_str: ${{ needs.build_cfg.outputs.VERSION_STR }}