diff --git a/.github/workflows/build_benchmark.yml b/.github/workflows/build_benchmark.yml index 67e3174a4..8f11c5696 100644 --- a/.github/workflows/build_benchmark.yml +++ b/.github/workflows/build_benchmark.yml @@ -24,9 +24,9 @@ jobs: - name: Get tag name (${{ github.ref }}) id: get_tag run: | - set -x - echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" - echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT + version_tag=$(echo ${GITHUB_REF/refs\/tags\//} | sed -r 's/^refs\/(heads|tags)\///' | sed -r 's/[-\/]+/_/g') + echo "VERSION_TAG=$version_tag" + echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT - name: Clone Repository (${{ steps.get_tag.outputs.VERSION_TAG }}) uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -36,8 +36,6 @@ jobs: - name: Prepare env id: prepare_env run: | - set -x - commit_count=$(git rev-list --count HEAD) echo "COMMIT_COUNT=$commit_count" echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT @@ -45,8 +43,6 @@ jobs: - name: Tag name id: tag_name run: | - set -x - if [ "${{ steps.get_tag.outputs.VERSION_TAG }}" = "master" ]; then tag_name=${{ steps.get_tag.outputs.VERSION_TAG }}-r${{ steps.prepare_env.outputs.COMMIT_COUNT }} else @@ -97,7 +93,7 @@ jobs: - name: Get SHA & clean up build artifacts id: get_sha run: | - set -ex + set -e mv app/build/outputs/apk/${{ needs.prepare-build.outputs.ARTIFACTS_PREFIX }}-universal-benchmark-signed.apk Komikku-${{ needs.prepare-build.outputs.TAG_NAME }}.apk mv app/build/outputs/apk/${{ needs.prepare-build.outputs.ARTIFACTS_PREFIX }}-arm64-v8a-benchmark-signed.apk Komikku-arm64-v8a-${{ needs.prepare-build.outputs.TAG_NAME }}.apk mv app/build/outputs/apk/${{ needs.prepare-build.outputs.ARTIFACTS_PREFIX }}-armeabi-v7a-benchmark-signed.apk Komikku-armeabi-v7a-${{ needs.prepare-build.outputs.TAG_NAME }}.apk @@ -108,4 +104,4 @@ jobs: uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: path: "**/*.apk" - retention-days: 90 + retention-days: 30 diff --git a/.github/workflows/build_dispatch_preview.yml b/.github/workflows/build_dispatch_preview.yml index 7a962488e..fc33a573f 100644 --- a/.github/workflows/build_dispatch_preview.yml +++ b/.github/workflows/build_dispatch_preview.yml @@ -16,6 +16,9 @@ on: # - '.github/scripts/**' # - '.github/workflows/**' +permissions: + contents: write + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -34,9 +37,8 @@ jobs: - name: Prepare build id: prepare_build run: | - set -x - commit_count=$(git rev-list --count HEAD) + echo "COMMIT_COUNT=$commit_count" echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT - name: Create Tag 'r${{ steps.prepare_build.outputs.COMMIT_COUNT }}' @@ -44,6 +46,7 @@ jobs: run: | git tag "r${{ steps.prepare_build.outputs.COMMIT_COUNT }}" git push origin "r${{ steps.prepare_build.outputs.COMMIT_COUNT }}" + echo "New tag created: r${{ steps.prepare_build.outputs.COMMIT_COUNT }}" - name: Get branch names id: branch_names diff --git a/.github/workflows/build_preview.yml b/.github/workflows/build_preview.yml index 268368625..97d25f062 100644 --- a/.github/workflows/build_preview.yml +++ b/.github/workflows/build_preview.yml @@ -38,9 +38,9 @@ jobs: - name: Get tag name (${{ github.ref }}) id: get_tag run: | - set -x - echo "VERSION_TAG=${GITHUB_REF/refs\/heads\//}" - echo "VERSION_TAG=${GITHUB_REF/refs\/heads\//}" >> $GITHUB_OUTPUT + version_tag=$(echo ${GITHUB_REF/refs\/heads\//} | sed -r 's/^refs\/(heads|tags)\///' | sed -r 's/[-\/]+/_/g') + echo "VERSION_TAG=$version_tag" + echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT - name: Clone Repository (${{ steps.get_tag.outputs.VERSION_TAG }}) uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -58,20 +58,16 @@ jobs: - name: Curren commit id: current_commit run: | - set -x - commit_count=$(git rev-list --count HEAD) + current_sha=$(git rev-parse --short HEAD) echo "COMMIT_COUNT=$commit_count" echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT - current_sha=$(git rev-parse --short HEAD) echo "CURRENT_SHA=$current_sha" echo "CURRENT_SHA=$current_sha" >> $GITHUB_OUTPUT - name: Previous commit id: previous_commit run: | - set -x - commit_count_diff=$(git rev-list --count "${{ steps.last_release.outputs.tag_name }}"..HEAD) # Fake at least 1 commits (to avoid no changes) @@ -89,8 +85,6 @@ jobs: - name: Prepare env id: prepare_env run: | - set -x - tag_prefix=r artifacts_prefix=preview/app build_type_name=Preview @@ -102,11 +96,16 @@ jobs: echo "BUILD_TYPE_NAME=$build_type_name" echo "BUILD_TYPE_NAME=$build_type_name" >> $GITHUB_OUTPUT + - name: Create Tag '${{ steps.prepare_env.outputs.TAG_NAME }}' + if: ${{ github.ref }} == "refs/heads/master" + run: | + git tag "${{ steps.prepare_env.outputs.TAG_NAME }}" + git push origin "${{ steps.prepare_env.outputs.TAG_NAME }}" + echo "New tag created: ${{ steps.prepare_env.outputs.TAG_NAME }}" + - name: Commit logs id: commit_logs run: | - set -x - echo "COMMIT_LOGS<<{delimiter} $(curl -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/komikku-app/komikku/compare/${{ steps.previous_commit.outputs.PREV_RELEASE_SHA }}...${{ steps.current_commit.outputs.CURRENT_SHA }}" \ diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml index 5ac0e6108..11710434e 100644 --- a/.github/workflows/build_pull_request.yml +++ b/.github/workflows/build_pull_request.yml @@ -8,12 +8,9 @@ on: pull_request: paths: - '**' - - '!i18n/src/commonMain/moko-resources/**/strings.xml' - - '!i18n/src/commonMain/moko-resources/**/plurals.xml' - - 'i18n/src/commonMain/moko-resources/base/strings.xml' - - 'i18n/src/commonMain/moko-resources/base/plurals.xml' - - 'i18n-sy/src/commonMain/moko-resources/base/strings.xml' - - 'i18n-sy/src/commonMain/moko-resources/base/plurals.xml' + - '!**.md' + - '!i18n-kmk/src/commonMain/moko-resources/**/strings.xml' + - '!i18n-kmk/src/commonMain/moko-resources/**/plurals.xml' - 'i18n-kmk/src/commonMain/moko-resources/base/strings.xml' - 'i18n-kmk/src/commonMain/moko-resources/base/plurals.xml' # Dispatch or Manual triggers @@ -98,13 +95,12 @@ jobs: id: signed_filename if: github.repository == github.event.pull_request.head.repo.full_name run: | - set -x echo "SIGNED_TRAIL=-signed" >> $GITHUB_OUTPUT - name: Rename apk id: current_commit run: | - set -ex + set -e echo "The git ref is: ${{ github.ref }}" version_tag=p$(echo ${{ github.ref }} | cut -d '/' -f 3) commit_count=$(git rev-list --count HEAD) diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index 00d9fd6c3..e9625790a 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -6,14 +6,7 @@ on: - master paths: - '**' - - '!i18n/src/commonMain/moko-resources/**/strings.xml' - - '!i18n/src/commonMain/moko-resources/**/plurals.xml' - - 'i18n/src/commonMain/moko-resources/base/strings.xml' - - 'i18n/src/commonMain/moko-resources/base/plurals.xml' - - 'i18n-sy/src/commonMain/moko-resources/base/strings.xml' - - 'i18n-sy/src/commonMain/moko-resources/base/plurals.xml' - - 'i18n-kmk/src/commonMain/moko-resources/base/strings.xml' - - 'i18n-kmk/src/commonMain/moko-resources/base/plurals.xml' + - '!**.md' # pull_request: # paths-ignore: # - '**.md' @@ -84,8 +77,8 @@ jobs: - name: Rename apk id: current_commit run: | - set -ex - version_tag=$(echo ${GITHUB_REF/refs\/heads\//} | sed -r 's/[\/]+/_/g') + set -e + version_tag=$(echo ${GITHUB_REF/refs\/heads\//} | sed -r 's/^refs\/(heads|tags)\///' | sed -r 's/[-\/]+/_/g') commit_count=$(git rev-list --count HEAD) echo "VERSION_TAG=$version_tag" echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 37722d677..48311609b 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -26,9 +26,9 @@ jobs: - name: Get tag name (${{ github.ref }}) id: get_tag run: | - set -x - echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" - echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT + version_tag=$(echo ${GITHUB_REF/refs\/tags\//} | sed -r 's/^refs\/(heads|tags)\///' | sed -r 's/[-\/]+/_/g') + echo "VERSION_TAG=$version_tag" + echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT - name: Clone Repository (${{ steps.get_tag.outputs.VERSION_TAG }}) uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -46,20 +46,16 @@ jobs: - name: Curren commit id: current_commit run: | - set -x - commit_count=$(git rev-list --count HEAD) + current_sha=$(git rev-parse --short HEAD) echo "COMMIT_COUNT=$commit_count" echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT - current_sha=$(git rev-parse --short HEAD) echo "CURRENT_SHA=$current_sha" echo "CURRENT_SHA=$current_sha" >> $GITHUB_OUTPUT - name: Previous commit id: previous_commit run: | - set -x - commit_count_diff=$(git rev-list --count "${{ steps.last_release.outputs.tag_name }}"..HEAD) # Fake at least 1 commits (to avoid no changes) @@ -77,8 +73,6 @@ jobs: - name: Commit logs id: commit_logs run: | - set -x - echo "COMMIT_LOGS<<{delimiter} $(curl -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/komikku-app/komikku/compare/${{ steps.previous_commit.outputs.PREV_RELEASE_SHA }}...${{ steps.current_commit.outputs.CURRENT_SHA }}" \