Fix (workflows): parsing version tag from refs
This commit is contained in:
parent
2e5c00c5a0
commit
04d90493d9
6 changed files with 32 additions and 51 deletions
14
.github/workflows/build_benchmark.yml
vendored
14
.github/workflows/build_benchmark.yml
vendored
|
|
@ -24,9 +24,9 @@ jobs:
|
||||||
- name: Get tag name (${{ github.ref }})
|
- name: Get tag name (${{ github.ref }})
|
||||||
id: get_tag
|
id: get_tag
|
||||||
run: |
|
run: |
|
||||||
set -x
|
version_tag=$(echo ${GITHUB_REF/refs\/tags\//} | sed -r 's/^refs\/(heads|tags)\///' | sed -r 's/[-\/]+/_/g')
|
||||||
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}"
|
echo "VERSION_TAG=$version_tag"
|
||||||
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
|
echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Clone Repository (${{ steps.get_tag.outputs.VERSION_TAG }})
|
- name: Clone Repository (${{ steps.get_tag.outputs.VERSION_TAG }})
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
|
@ -36,8 +36,6 @@ jobs:
|
||||||
- name: Prepare env
|
- name: Prepare env
|
||||||
id: prepare_env
|
id: prepare_env
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
|
|
||||||
commit_count=$(git rev-list --count HEAD)
|
commit_count=$(git rev-list --count HEAD)
|
||||||
echo "COMMIT_COUNT=$commit_count"
|
echo "COMMIT_COUNT=$commit_count"
|
||||||
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
|
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
|
||||||
|
|
@ -45,8 +43,6 @@ jobs:
|
||||||
- name: Tag name
|
- name: Tag name
|
||||||
id: tag_name
|
id: tag_name
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
|
|
||||||
if [ "${{ steps.get_tag.outputs.VERSION_TAG }}" = "master" ]; then
|
if [ "${{ steps.get_tag.outputs.VERSION_TAG }}" = "master" ]; then
|
||||||
tag_name=${{ steps.get_tag.outputs.VERSION_TAG }}-r${{ steps.prepare_env.outputs.COMMIT_COUNT }}
|
tag_name=${{ steps.get_tag.outputs.VERSION_TAG }}-r${{ steps.prepare_env.outputs.COMMIT_COUNT }}
|
||||||
else
|
else
|
||||||
|
|
@ -97,7 +93,7 @@ jobs:
|
||||||
- name: Get SHA & clean up build artifacts
|
- name: Get SHA & clean up build artifacts
|
||||||
id: get_sha
|
id: get_sha
|
||||||
run: |
|
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 }}-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 }}-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
|
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
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
path: "**/*.apk"
|
path: "**/*.apk"
|
||||||
retention-days: 90
|
retention-days: 30
|
||||||
|
|
|
||||||
7
.github/workflows/build_dispatch_preview.yml
vendored
7
.github/workflows/build_dispatch_preview.yml
vendored
|
|
@ -16,6 +16,9 @@ on:
|
||||||
# - '.github/scripts/**'
|
# - '.github/scripts/**'
|
||||||
# - '.github/workflows/**'
|
# - '.github/workflows/**'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
@ -34,9 +37,8 @@ jobs:
|
||||||
- name: Prepare build
|
- name: Prepare build
|
||||||
id: prepare_build
|
id: prepare_build
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
|
|
||||||
commit_count=$(git rev-list --count HEAD)
|
commit_count=$(git rev-list --count HEAD)
|
||||||
|
echo "COMMIT_COUNT=$commit_count"
|
||||||
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
|
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create Tag 'r${{ steps.prepare_build.outputs.COMMIT_COUNT }}'
|
- name: Create Tag 'r${{ steps.prepare_build.outputs.COMMIT_COUNT }}'
|
||||||
|
|
@ -44,6 +46,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
git tag "r${{ steps.prepare_build.outputs.COMMIT_COUNT }}"
|
git tag "r${{ steps.prepare_build.outputs.COMMIT_COUNT }}"
|
||||||
git push origin "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
|
- name: Get branch names
|
||||||
id: branch_names
|
id: branch_names
|
||||||
|
|
|
||||||
23
.github/workflows/build_preview.yml
vendored
23
.github/workflows/build_preview.yml
vendored
|
|
@ -38,9 +38,9 @@ jobs:
|
||||||
- name: Get tag name (${{ github.ref }})
|
- name: Get tag name (${{ github.ref }})
|
||||||
id: get_tag
|
id: get_tag
|
||||||
run: |
|
run: |
|
||||||
set -x
|
version_tag=$(echo ${GITHUB_REF/refs\/heads\//} | sed -r 's/^refs\/(heads|tags)\///' | sed -r 's/[-\/]+/_/g')
|
||||||
echo "VERSION_TAG=${GITHUB_REF/refs\/heads\//}"
|
echo "VERSION_TAG=$version_tag"
|
||||||
echo "VERSION_TAG=${GITHUB_REF/refs\/heads\//}" >> $GITHUB_OUTPUT
|
echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Clone Repository (${{ steps.get_tag.outputs.VERSION_TAG }})
|
- name: Clone Repository (${{ steps.get_tag.outputs.VERSION_TAG }})
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
|
@ -58,20 +58,16 @@ jobs:
|
||||||
- name: Curren commit
|
- name: Curren commit
|
||||||
id: current_commit
|
id: current_commit
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
|
|
||||||
commit_count=$(git rev-list --count HEAD)
|
commit_count=$(git rev-list --count HEAD)
|
||||||
|
current_sha=$(git rev-parse --short HEAD)
|
||||||
echo "COMMIT_COUNT=$commit_count"
|
echo "COMMIT_COUNT=$commit_count"
|
||||||
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
|
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
|
||||||
current_sha=$(git rev-parse --short HEAD)
|
|
||||||
echo "CURRENT_SHA=$current_sha"
|
echo "CURRENT_SHA=$current_sha"
|
||||||
echo "CURRENT_SHA=$current_sha" >> $GITHUB_OUTPUT
|
echo "CURRENT_SHA=$current_sha" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Previous commit
|
- name: Previous commit
|
||||||
id: previous_commit
|
id: previous_commit
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
|
|
||||||
commit_count_diff=$(git rev-list --count "${{ steps.last_release.outputs.tag_name }}"..HEAD)
|
commit_count_diff=$(git rev-list --count "${{ steps.last_release.outputs.tag_name }}"..HEAD)
|
||||||
|
|
||||||
# Fake at least 1 commits (to avoid no changes)
|
# Fake at least 1 commits (to avoid no changes)
|
||||||
|
|
@ -89,8 +85,6 @@ jobs:
|
||||||
- name: Prepare env
|
- name: Prepare env
|
||||||
id: prepare_env
|
id: prepare_env
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
|
|
||||||
tag_prefix=r
|
tag_prefix=r
|
||||||
artifacts_prefix=preview/app
|
artifacts_prefix=preview/app
|
||||||
build_type_name=Preview
|
build_type_name=Preview
|
||||||
|
|
@ -102,11 +96,16 @@ jobs:
|
||||||
echo "BUILD_TYPE_NAME=$build_type_name"
|
echo "BUILD_TYPE_NAME=$build_type_name"
|
||||||
echo "BUILD_TYPE_NAME=$build_type_name" >> $GITHUB_OUTPUT
|
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
|
- name: Commit logs
|
||||||
id: commit_logs
|
id: commit_logs
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
|
|
||||||
echo "COMMIT_LOGS<<{delimiter}
|
echo "COMMIT_LOGS<<{delimiter}
|
||||||
$(curl -H "Accept: application/vnd.github.v3+json" \
|
$(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 }}" \
|
"https://api.github.com/repos/komikku-app/komikku/compare/${{ steps.previous_commit.outputs.PREV_RELEASE_SHA }}...${{ steps.current_commit.outputs.CURRENT_SHA }}" \
|
||||||
|
|
|
||||||
12
.github/workflows/build_pull_request.yml
vendored
12
.github/workflows/build_pull_request.yml
vendored
|
|
@ -8,12 +8,9 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '**'
|
- '**'
|
||||||
- '!i18n/src/commonMain/moko-resources/**/strings.xml'
|
- '!**.md'
|
||||||
- '!i18n/src/commonMain/moko-resources/**/plurals.xml'
|
- '!i18n-kmk/src/commonMain/moko-resources/**/strings.xml'
|
||||||
- 'i18n/src/commonMain/moko-resources/base/strings.xml'
|
- '!i18n-kmk/src/commonMain/moko-resources/**/plurals.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/strings.xml'
|
||||||
- 'i18n-kmk/src/commonMain/moko-resources/base/plurals.xml'
|
- 'i18n-kmk/src/commonMain/moko-resources/base/plurals.xml'
|
||||||
# Dispatch or Manual triggers
|
# Dispatch or Manual triggers
|
||||||
|
|
@ -98,13 +95,12 @@ jobs:
|
||||||
id: signed_filename
|
id: signed_filename
|
||||||
if: github.repository == github.event.pull_request.head.repo.full_name
|
if: github.repository == github.event.pull_request.head.repo.full_name
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
echo "SIGNED_TRAIL=-signed" >> $GITHUB_OUTPUT
|
echo "SIGNED_TRAIL=-signed" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Rename apk
|
- name: Rename apk
|
||||||
id: current_commit
|
id: current_commit
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -e
|
||||||
echo "The git ref is: ${{ github.ref }}"
|
echo "The git ref is: ${{ github.ref }}"
|
||||||
version_tag=p$(echo ${{ github.ref }} | cut -d '/' -f 3)
|
version_tag=p$(echo ${{ github.ref }} | cut -d '/' -f 3)
|
||||||
commit_count=$(git rev-list --count HEAD)
|
commit_count=$(git rev-list --count HEAD)
|
||||||
|
|
|
||||||
13
.github/workflows/build_push.yml
vendored
13
.github/workflows/build_push.yml
vendored
|
|
@ -6,14 +6,7 @@ on:
|
||||||
- master
|
- master
|
||||||
paths:
|
paths:
|
||||||
- '**'
|
- '**'
|
||||||
- '!i18n/src/commonMain/moko-resources/**/strings.xml'
|
- '!**.md'
|
||||||
- '!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'
|
|
||||||
# pull_request:
|
# pull_request:
|
||||||
# paths-ignore:
|
# paths-ignore:
|
||||||
# - '**.md'
|
# - '**.md'
|
||||||
|
|
@ -84,8 +77,8 @@ jobs:
|
||||||
- name: Rename apk
|
- name: Rename apk
|
||||||
id: current_commit
|
id: current_commit
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -e
|
||||||
version_tag=$(echo ${GITHUB_REF/refs\/heads\//} | sed -r 's/[\/]+/_/g')
|
version_tag=$(echo ${GITHUB_REF/refs\/heads\//} | sed -r 's/^refs\/(heads|tags)\///' | sed -r 's/[-\/]+/_/g')
|
||||||
commit_count=$(git rev-list --count HEAD)
|
commit_count=$(git rev-list --count HEAD)
|
||||||
echo "VERSION_TAG=$version_tag"
|
echo "VERSION_TAG=$version_tag"
|
||||||
echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT
|
echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT
|
||||||
|
|
|
||||||
14
.github/workflows/build_release.yml
vendored
14
.github/workflows/build_release.yml
vendored
|
|
@ -26,9 +26,9 @@ jobs:
|
||||||
- name: Get tag name (${{ github.ref }})
|
- name: Get tag name (${{ github.ref }})
|
||||||
id: get_tag
|
id: get_tag
|
||||||
run: |
|
run: |
|
||||||
set -x
|
version_tag=$(echo ${GITHUB_REF/refs\/tags\//} | sed -r 's/^refs\/(heads|tags)\///' | sed -r 's/[-\/]+/_/g')
|
||||||
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}"
|
echo "VERSION_TAG=$version_tag"
|
||||||
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
|
echo "VERSION_TAG=$version_tag" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Clone Repository (${{ steps.get_tag.outputs.VERSION_TAG }})
|
- name: Clone Repository (${{ steps.get_tag.outputs.VERSION_TAG }})
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
|
@ -46,20 +46,16 @@ jobs:
|
||||||
- name: Curren commit
|
- name: Curren commit
|
||||||
id: current_commit
|
id: current_commit
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
|
|
||||||
commit_count=$(git rev-list --count HEAD)
|
commit_count=$(git rev-list --count HEAD)
|
||||||
|
current_sha=$(git rev-parse --short HEAD)
|
||||||
echo "COMMIT_COUNT=$commit_count"
|
echo "COMMIT_COUNT=$commit_count"
|
||||||
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
|
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_OUTPUT
|
||||||
current_sha=$(git rev-parse --short HEAD)
|
|
||||||
echo "CURRENT_SHA=$current_sha"
|
echo "CURRENT_SHA=$current_sha"
|
||||||
echo "CURRENT_SHA=$current_sha" >> $GITHUB_OUTPUT
|
echo "CURRENT_SHA=$current_sha" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Previous commit
|
- name: Previous commit
|
||||||
id: previous_commit
|
id: previous_commit
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
|
|
||||||
commit_count_diff=$(git rev-list --count "${{ steps.last_release.outputs.tag_name }}"..HEAD)
|
commit_count_diff=$(git rev-list --count "${{ steps.last_release.outputs.tag_name }}"..HEAD)
|
||||||
|
|
||||||
# Fake at least 1 commits (to avoid no changes)
|
# Fake at least 1 commits (to avoid no changes)
|
||||||
|
|
@ -77,8 +73,6 @@ jobs:
|
||||||
- name: Commit logs
|
- name: Commit logs
|
||||||
id: commit_logs
|
id: commit_logs
|
||||||
run: |
|
run: |
|
||||||
set -x
|
|
||||||
|
|
||||||
echo "COMMIT_LOGS<<{delimiter}
|
echo "COMMIT_LOGS<<{delimiter}
|
||||||
$(curl -H "Accept: application/vnd.github.v3+json" \
|
$(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 }}" \
|
"https://api.github.com/repos/komikku-app/komikku/compare/${{ steps.previous_commit.outputs.PREV_RELEASE_SHA }}...${{ steps.current_commit.outputs.CURRENT_SHA }}" \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue