Skip to content

Commit

Permalink
fix: tag versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebus-84 committed Oct 9, 2024
1 parent 328960a commit b66db65
Showing 1 changed file with 41 additions and 37 deletions.
78 changes: 41 additions & 37 deletions .github/workflows/build_alpha_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b66db65

Please sign in to comment.