diff --git a/.github/workflows/build_aux_files.yml b/.github/workflows/build_aux_files.yml index d83ff6112..739255cff 100644 --- a/.github/workflows/build_aux_files.yml +++ b/.github/workflows/build_aux_files.yml @@ -20,21 +20,51 @@ jobs: actions: read runs-on: ubuntu-latest + steps: - name: Checkout repository uses: actions/checkout@v5 with: fetch-depth: 0 - + # Step 1: Determine Tag and Release Name based on branch + # This sets environment variables for the rest of the workflow + # name is different if it's dev branch or other (main or master) + - name: Set Release Variables + run: | + if [[ "${{ github.ref_name }}" == "dev" ]]; then + echo "TARGET_TAG=Development" >> $GITHUB_ENV + echo "RELEASE_NAME=Development Build" >> $GITHUB_ENV + else + echo "TARGET_TAG=Nightly" >> $GITHUB_ENV + echo "RELEASE_NAME=Nightly Build" >> $GITHUB_ENV + fi + + # Step 2: Update Tag using native Git commands + - name: Update Git Tag + run: | + # Configure identity + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + # Force the tag locally and push it to origin + # Use the environment variable set in Step 1 + git tag -f ${{ env.TARGET_TAG }} + git push -f origin ${{ env.TARGET_TAG }} + + # Step 3: Generate the file to upload - name: Generate changelog run: git log --pretty=format:"%ad %an %s" --date=short > Git-Changelog.txt - + + # Step 4: Update the GitHub Release page - name: Add auxiliary files to the release uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: Nightly - tag_name: Nightly + # Use dynamic variables + name: "${{ env.RELEASE_NAME }}" + tag_name: ${{ env.TARGET_TAG }} prerelease: true files: Git-Changelog.txt + # Overwrite existing assets with the same name + overwrite_files: true \ No newline at end of file diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index 3ba0f5bc5..90f30cc25 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -12,7 +12,25 @@ on: workflow_dispatch: jobs: + # This job checks if the secret is available + check-secret: + runs-on: ubuntu-latest + outputs: + has_token: ${{ steps.check.outputs.has_token }} + steps: + - name: Check for Coverity Token + id: check + shell: bash + run: | + if [ -n "${{ secrets.COVERITY_TOKEN }}" ]; then + echo "has_token=true" >> $GITHUB_OUTPUT + else + echo "has_token=false" >> $GITHUB_OUTPUT + fi + latest: + needs: check-secret + if: needs.check-secret.outputs.has_token == 'true' runs-on: ubuntu-24.04 permissions: contents: read