From 147db5c9ea085c84af1a39dbf662c0b17161ac84 Mon Sep 17 00:00:00 2001 From: phoebus-84 <83974413+phoebus-84@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:07:53 +0200 Subject: [PATCH] fix: tag versioning (#86) * fix: tag versioning * ci: remove codeql action --------- Co-authored-by: matteo-cristino --- .github/workflows/build_alpha_release.yml | 113 ++++++++-------------- .github/workflows/codeql.yml | 82 ---------------- 2 files changed, 40 insertions(+), 155 deletions(-) delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/build_alpha_release.yml b/.github/workflows/build_alpha_release.yml index a6d276a..55e31e3 100644 --- a/.github/workflows/build_alpha_release.yml +++ b/.github/workflows/build_alpha_release.yml @@ -5,24 +5,48 @@ on: branches: ['main'] jobs: - build_android: + 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: Git Sumbodule Update - run: | - git submodule update --init - - name: Install Node.js - uses: actions/setup-node@v4 + - uses: dyne/pnpm@main with: node-version: 20 - - uses: pnpm/action-setup@v2 - name: Install pnpm + pnpm-version: 8 + - 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 + if: ${{ needs.semantic-release.outputs.release == 'True' }} + steps: + - uses: dyne/pnpm@main with: - version: 8 - run_install: false - - - uses: actions/cache@v3 + submodules: true + node-version: 20 + pnpm-version: 8 + - uses: actions/cache@v4 with: path: | ~/.gradle/caches @@ -45,7 +69,7 @@ jobs: with: ruby-version: '3.0' bundler-cache: true - - uses: maierj/fastlane-action@v3.0.0 + - uses: maierj/fastlane-action@v3.1.0 env: KEYSTORE_PATH: ${{ steps.android_keystore.outputs.filePath }} KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} @@ -55,68 +79,11 @@ jobs: with: lane: alpha - run: mv release.apk verifier.apk - - name: upload binary artifacts - uses: actions/upload-artifact@v4 - with: - name: verifier - 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: - contents: write - needs: semantic-release - runs-on: ubuntu-latest - if: ${{ needs.semantic-release.outputs.release == 'True' }} - steps: - - name: download binary artifacts - uses: actions/download-artifact@v4 - with: - path: | - release - name: relase all binary artifacts - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: | - release/verifier/* + verifier.apk draft: false prerelease: false fail_on_unmatched_files: true diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index a8af5ca..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,82 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "main" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '20 22 * * 5' - -jobs: - analyze: - name: Analyze - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners - # Consider using larger runners for possible analysis time improvements. - runs-on: ubuntu-latest - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript-typescript' ] - # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] - # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}"