From b66db65768ae9763d220b8ba48508268371c16fc Mon Sep 17 00:00:00 2001 From: phoebus-84 Date: Wed, 9 Oct 2024 15:08:38 +0200 Subject: [PATCH] fix: tag versioning --- .github/workflows/build_alpha_release.yml | 78 ++++++++++++----------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build_alpha_release.yml b/.github/workflows/build_alpha_release.yml index a6d276a..57d56d9 100644 --- a/.github/workflows/build_alpha_release.yml +++ b/.github/workflows/build_alpha_release.yml @@ -5,8 +5,48 @@ on: branches: ['main'] jobs: + semantic-release: + permissions: + contents: write + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + outputs: + release: ${{ steps.tag_release.outputs.release }} + version: ${{ steps.tag_release.outputs.version }} + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js 18 + uses: actions/setup-node@v4 + with: + node-version: 20 + - uses: pnpm/action-setup@v2 + name: Install pnpm + with: + version: 8 + - name: Install deps + run: | + pnpm i + - name: Tag release + id: tag_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + npx semantic-release >semantic-release.log + cat semantic-release.log + if [[ `git tag --points-at HEAD` == "" ]]; then + echo "release=False" >> $GITHUB_OUTPUT + else + echo "release=True" >> $GITHUB_OUTPUT + awk '/Published release/ { printf("version=v%s\n",$8) }' semantic-release.log >> $GITHUB_OUTPUT + fi + echo "Result" + cat $GITHUB_OUTPUT + + + build_android: runs-on: ubuntu-latest + needs: semantic-release steps: - uses: actions/checkout@v4 - name: Git Sumbodule Update @@ -62,43 +102,7 @@ jobs: path: | verifier.apk - semantic-release: - permissions: - contents: write - needs: build_android - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - outputs: - release: ${{ steps.tag_release.outputs.release }} - version: ${{ steps.tag_release.outputs.version }} - steps: - - uses: actions/checkout@v4 - - name: Setup Node.js 18 - uses: actions/setup-node@v4 - with: - node-version: 20 - - uses: pnpm/action-setup@v2 - name: Install pnpm - with: - version: 8 - - name: Install deps - run: | - pnpm i - - name: Tag release - id: tag_release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - npx semantic-release >semantic-release.log - cat semantic-release.log - if [[ `git tag --points-at HEAD` == "" ]]; then - echo "release=False" >> $GITHUB_OUTPUT - else - echo "release=True" >> $GITHUB_OUTPUT - awk '/Published release/ { printf("version=v%s\n",$8) }' semantic-release.log >> $GITHUB_OUTPUT - fi - echo "Result" - cat $GITHUB_OUTPUT + draft-release: permissions: