diff --git a/.github/actions/get-server-version/action.yaml b/.github/actions/get-server-version/action.yaml index 8c535db..ea5bf62 100644 --- a/.github/actions/get-server-version/action.yaml +++ b/.github/actions/get-server-version/action.yaml @@ -1,21 +1,15 @@ name: "Get Server Version" -description: "Load latest working stable server version" +description: "Load latest version if input is empty or other pre-determined strings " inputs: - force: + version: description: "Version Override" required: false outputs: version: - description: "Clear Version (removes 'v' when necessary" + description: "Version of the Server" value: ${{ steps.get_version_file.outputs.version }} - is_semver: - description: "If version is a SEMVER or tag/brach" - value: ${{ steps.get_version_file.outputs.is_semver }} - ete_version: - description: "Etebase Version" - value: ${{ steps.get_version_file.outputs.ete_version }} runs: using: "composite" @@ -23,26 +17,13 @@ runs: - id: get_version_file shell: bash env: - OVERRIDE: ${{ inputs.force }} + OVERRIDE: ${{ inputs.version }} run: | - if [ -z "${OVERRIDE}" ]; then + if [ -z "${OVERRIDE}" ] || [ "${OVERRIDE}" = "latest" ] || [ "${OVERRIDE}" = "stable" ] ; then source ./server_version else ETESYNC_VERSION="${OVERRIDE}" fi - CLEAN_VERSION="${ETESYNC_VERSION#v}" - - if [[ ${CLEAN_VERSION} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - SEMVER='true' - else - SEMVER='false' - fi - - echo "*Version*: ${CLEAN_VERSION}" >> $GITHUB_STEP_SUMMARY - echo "*Is SemVer*? ${SEMVER}" >> $GITHUB_STEP_SUMMARY - echo "*Etesync Version*: ${ETESYNC_VERSION}" >> $GITHUB_STEP_SUMMARY - - echo "version=${CLEAN_VERSION}" >> $GITHUB_OUTPUT - echo "is_semver=${SEMVER}" >> $GITHUB_OUTPUT - echo "ete_version=${ETESYNC_VERSION}" >> $GITHUB_OUTPUT \ No newline at end of file + echo "*Version*: ${ETESYNC_VERSION}" >> $GITHUB_STEP_SUMMARY + echo "version=${ETESYNC_VERSION}" >> $GITHUB_OUTPUT \ No newline at end of file diff --git a/.github/actions/process-version/action.yaml b/.github/actions/process-version/action.yaml new file mode 100644 index 0000000..d3aba07 --- /dev/null +++ b/.github/actions/process-version/action.yaml @@ -0,0 +1,46 @@ +name: "Preocess Version Data" +description: "Prepare and extract version information and variants" + +inputs: + version: + description: "the target server version" + required: true + +outputs: + version: + description: "Clear Version (removes 'v' when necessary)" + value: ${{ steps.get_version_file.outputs.version }} + is_semver: + description: "If version is a SEMVER or tag/brach" + value: ${{ steps.get_version_file.outputs.is_semver }} + ete_version: + description: "Etebase Version" + value: ${{ steps.get_version_file.outputs.ete_version }} + +runs: + using: "composite" + steps: + - id: export_version + shell: bash + env: + VERSION: ${{ inputs.version }} + run: | + echo $VERSION + + CLEAN_VERSION="${VERSION#v}" + + if [[ ${CLEAN_VERSION} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + SEMVER='true' + ETESYNC_VERSION="v${CLEAN_VERSION}" + else + SEMVER='false' + ETESYNC_VERSION="${CLEAN_VERSION}" + fi + + echo "*Version*: ${CLEAN_VERSION}" >> $GITHUB_STEP_SUMMARY + echo "*Is SemVer*? ${SEMVER}" >> $GITHUB_STEP_SUMMARY + echo "*Etesync Version*: ${ETESYNC_VERSION}" >> $GITHUB_STEP_SUMMARY + + echo "version=${CLEAN_VERSION}" >> $GITHUB_OUTPUT + echo "is_semver=${SEMVER}" >> $GITHUB_OUTPUT + echo "ete_version=${ETESYNC_VERSION}" >> $GITHUB_OUTPUT \ No newline at end of file diff --git a/.github/workflows/call_build_push.yml b/.github/workflows/call_build_push.yml index 3411043..89636bf 100644 --- a/.github/workflows/call_build_push.yml +++ b/.github/workflows/call_build_push.yml @@ -11,11 +11,11 @@ on: type: string version: description: "EteBase Version" - required: false + required: true type: string platforms: - description: "Set the platforms to build [ linux/amd64, linux/arm64 or linux/arm/v7 ]" - default: "linux/amd64,linux/arm64,linux/arm/v7" + description: "Set the platforms to build [ linux/amd64 and/or linux/arm64 ]" + default: "linux/amd64,linux/arm64" required: false type: string tag: @@ -39,21 +39,19 @@ jobs: steps: - name: Checkout Dockerfiles and Context uses: actions/checkout@v4 - with: - fetch-depth: 0 - - id: server_version - name: Get Server Version - uses: ./.github/actions/get-server-version + - id: process_version + name: Process Version data + uses: ./.github/actions/process-version with: - force: ${{ inputs.version }} + version: ${{ inputs.version }} - id: build_metadata name: Prepare Project Metadata uses: ./.github/actions/build-metadata with: flavor: ${{ inputs.flavor }} - version: ${{ steps.server_version.outputs.version }} + version: ${{ steps.process_version.outputs.version }} - id: docker_metadata name: Prepare Docker Metadata @@ -69,14 +67,14 @@ jobs: victorrds/etebase victorrds/etesync flavor: | - latest=${{ ( inputs.flavor == 'base' && steps.server_version.outputs.is_semver == 'true' ) }} + latest=${{ ( inputs.flavor == 'base' && steps.process_version.outputs.is_semver == 'true' ) }} suffix=${{ steps.build_metadata.outputs.suffix }} tags: | type=edge,enable=${{ inputs.tag != '' }},branch=${{ steps.build_metadata.outputs.source_name }} type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }} - type=raw,value=${{ inputs.flavor }},suffix=,enable=${{ inputs.tag == '' && steps.server_version.outputs.is_semver == 'true' }} - type=semver,pattern={{version}},value=${{ steps.server_version.outputs.ete_version }},enable=${{ inputs.tag == '' && steps.server_version.outputs.is_semver == 'true' }} - type=semver,pattern={{major}}.{{minor}},value=${{ steps.server_version.outputs.ete_version }},enable=${{ inputs.tag == '' && steps.server_version.outputs.is_semver == 'true' }} + type=raw,value=${{ inputs.flavor }},suffix=,enable=${{ inputs.tag == '' && steps.process_version.outputs.is_semver == 'true' }} + type=semver,pattern={{version}},value=${{ steps.process_version.outputs.ete_version }},enable=${{ inputs.tag == '' && steps.process_version.outputs.is_semver == 'true' }} + type=semver,pattern={{major}}.{{minor}},value=${{ steps.process_version.outputs.ete_version }},enable=${{ inputs.tag == '' && steps.process_version.outputs.is_semver == 'true' }} - id: qemu name: Set up QEMU @@ -102,7 +100,7 @@ jobs: platforms: ${{ inputs.platforms }} context: . file: ./tags/${{ inputs.flavor }}/Dockerfile - build-args: ETE_VERSION=${{ steps.server_version.outputs.ete_version }} + build-args: ETE_VERSION=${{ steps.process_version.outputs.ete_version }} tags: ${{ steps.docker_metadata.outputs.tags }} labels: ${{ steps.docker_metadata.outputs.labels }} push: ${{ inputs.pushit }} @@ -118,7 +116,7 @@ jobs: fi cat >> summary.md << EOF - Etesync Version: ${{ steps.server_version.outputs.ete_version }} + Etesync Version: ${{ steps.process_version.outputs.ete_version }} Image Type: ${{ inputs.flavor }} Platforms: ${{ inputs.platforms }} EOF diff --git a/.github/workflows/call_pr_build.yml b/.github/workflows/call_pr_build.yml index 447fd40..63ad9b8 100644 --- a/.github/workflows/call_pr_build.yml +++ b/.github/workflows/call_pr_build.yml @@ -11,7 +11,7 @@ on: type: string version: description: "EteBase Version" - required: false + required: true type: string jobs: @@ -21,10 +21,11 @@ jobs: - name: Checkout Dockerfiles and Context uses: actions/checkout@v4 - - id: server_version - uses: ./.github/actions/get-server-version + - id: process_version + name: Process Version data + uses: ./.github/actions/process-version with: - force: ${{ inputs.version }} + version: ${{ inputs.version }} - id: buildx name: Set up Docker Buildx @@ -38,5 +39,5 @@ jobs: context: . file: ./tags/${{ inputs.flavor }}/Dockerfile tags: victorrds/etebase:${{ github.sha }}-${{ inputs.flavor }} - build-args: ETE_VERSION=${{ steps.server_version.outputs.ete_version }} + build-args: ETE_VERSION=${{ steps.process_version.outputs.ete_version }} push: false \ No newline at end of file diff --git a/.github/workflows/call_release.yml b/.github/workflows/call_release.yml index 95210d3..1a0449b 100644 --- a/.github/workflows/call_release.yml +++ b/.github/workflows/call_release.yml @@ -6,27 +6,26 @@ on: inputs: version: description: "EteBase Version" - required: false + required: true type: string jobs: - build-n-push: + releases-only: runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - id: server_version - uses: ./.github/actions/get-server-version + - id: process_version + name: Process Version data + uses: ./.github/actions/process-version with: - force: ${{ inputs.version }} + version: ${{ inputs.version }} - id: create_release name: Create Release - if: ${{ steps.server_version.outputs.is_semver == 'true' }} + if: ${{ steps.process_version.outputs.is_semver == 'true' }} uses: ncipollo/release-action@v1 with: allowUpdates: true @@ -34,7 +33,7 @@ jobs: removeArtifacts: true replacesArtifacts: true commit: ${{ github.sha }} - name: "${{ steps.server_version.outputs.version }}" + name: "${{ steps.process_version.outputs.version }}" generateReleaseNotes: true prerelease: false - tag: ${{ steps.server_version.outputs.version }} + tag: ${{ steps.process_version.outputs.version }} diff --git a/.github/workflows/manual-build-all.yml b/.github/workflows/manual-build-all.yml deleted file mode 100644 index 512e9ab..0000000 --- a/.github/workflows/manual-build-all.yml +++ /dev/null @@ -1,77 +0,0 @@ ---- -name: Manual Build - All - -on: - workflow_dispatch: - inputs: - version: - description: "EteBase Version" - required: false - default: "" - type: string - platforms: - description: "Platforms to build" - required: false - default: "linux/amd64,linux/arm64,linux/arm/v7" - type: choice - options: - - "linux/amd64,linux/arm64,linux/arm/v7" - - "linux/amd64,linux/arm64" - - "linux/arm64,linux/arm/v7" - - "linux/amd64" - - "linux/arm64" - - "linux/arm/v7" - pushit: - description: "Should push?" - required: false - default: false - type: boolean - tag: - description: "Custom Tag" - required: false - default: "" - type: string - -jobs: - base-manual: - uses: ./.github/workflows/call_build_push.yml - with: - flavor: "base" - version: ${{ github.event.inputs.version }} - platforms: ${{ github.event.inputs.platforms }} - pushit: ${{ github.event.inputs.pushit == 'true' }} - tag: ${{ github.event.inputs.tag }} - secrets: - dckr_username: ${{ secrets.DOCKER_USER }} - dckr_token: ${{ secrets.DOCKER_TOKEN }} - - slim-manual: - uses: ./.github/workflows/call_build_push.yml - with: - flavor: "slim" - version: ${{ github.event.inputs.version }} - platforms: ${{ github.event.inputs.platforms }} - pushit: ${{ github.event.inputs.pushit == 'true' }} - tag: ${{ github.event.inputs.tag }} - secrets: - dckr_username: ${{ secrets.DOCKER_USER }} - dckr_token: ${{ secrets.DOCKER_TOKEN }} - - alpine-manual: - uses: ./.github/workflows/call_build_push.yml - with: - flavor: "alpine" - version: ${{ github.event.inputs.version }} - platforms: ${{ github.event.inputs.platforms }} - pushit: ${{ github.event.inputs.pushit == 'true' }} - tag: ${{ github.event.inputs.tag }} - secrets: - dckr_username: ${{ secrets.DOCKER_USER }} - dckr_token: ${{ secrets.DOCKER_TOKEN }} - - create-releases: - if: inputs.pushit - needs: [base-manual, slim-manual, alpine-manual] - uses: ./.github/workflows/call_release.yml - with: - version: ${{ github.event.inputs.version }} \ No newline at end of file diff --git a/.github/workflows/manual-build-single.yml b/.github/workflows/manual-build-single.yml deleted file mode 100644 index b8d5293..0000000 --- a/.github/workflows/manual-build-single.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -name: Manual Build - Sigle Flavor - -on: - workflow_dispatch: - inputs: - flavor: - description: "Base image" - default: "base" - required: false - type: choice - options: - - "base" - - "slim" - - "alpine" - version: - description: "EteBase Version" - required: false - default: "" - type: string - platforms: - description: "Platforms to build" - required: false - default: "linux/amd64,linux/arm64,linux/arm/v7" - type: choice - options: - - "linux/amd64,linux/arm64,linux/arm/v7" - - "linux/amd64,linux/arm64" - - "linux/arm64,linux/arm/v7" - - "linux/amd64" - - "linux/arm64" - - "linux/arm/v7" - pushit: - description: "Should push?" - required: false - default: false - type: boolean - tag: - description: "Custom Tag" - required: false - default: "" - type: string - -jobs: - manual-build: - uses: ./.github/workflows/call_build_push.yml - with: - flavor: ${{ github.event.inputs.flavor }} - version: ${{ github.event.inputs.version }} - platforms: ${{ github.event.inputs.platforms }} - pushit: ${{ github.event.inputs.pushit == 'true' }} - tag: ${{ github.event.inputs.tag }} - secrets: - dckr_username: ${{ secrets.DOCKER_USER }} - dckr_token: ${{ secrets.DOCKER_TOKEN }} diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml index 8399263..ee7e560 100644 --- a/.github/workflows/manual-build.yml +++ b/.github/workflows/manual-build.yml @@ -25,15 +25,15 @@ on: platforms: description: "Platforms to build" required: false - default: '[ "linux/amd64","linux/arm64" ]' + default: "linux/amd64,linux/arm64" type: choice options: - - '[ "linux/amd64","linux/arm64","linux/arm/v7" ]' - - '[ "linux/amd64","linux/arm64" ]' - - '[ "linux/arm64","linux/arm/v7" ]' - - '[ "linux/amd64" ]' - - '[ "linux/arm64" ]' - - '[ "linux/arm/v7" ]' + - "linux/amd64,linux/arm64,linux/arm/v7" + - "linux/amd64,linux/arm64" + - "linux/arm64,linux/arm/v7" + - "linux/amd64" + - "linux/arm64" + - "linux/arm/v7" pushit: description: "Should push?" required: false @@ -46,25 +46,43 @@ on: type: string jobs: + prepare-manual-build: + runs-on: ubuntu-latest + outputs: + ete_version: ${{ steps.get_version.outputs.version }} + steps: + - name: Checkout Version and Workflow files + uses: actions/checkout@v4 + with: + sparse-checkout: | + server_version + ./.github/actions/get-server-version + sparse-checkout-cone-mode: false + - id: get_version + name: Get Server Version + uses: ./.github/actions/get-server-version + with: + version: ${{ github.event.inputs.version }} + manual-build-matrix: + needs: prepare-manual-build uses: ./.github/workflows/call_build_push.yml strategy: matrix: - platform: ${{ fromJson(github.event.inputs.platforms) }} flavor: ${{ fromJson(github.event.inputs.flavors) }} with: flavor: ${{ matrix.flavor }} - version: ${{ github.event.inputs.version }} - platforms: ${{ matrix.platform }} + version: ${{ needs.prepare-manual-build.outputs.ete_version }} + platforms: ${{ github.event.inputs.platforms }} pushit: ${{ github.event.inputs.pushit == 'true' }} tag: ${{ github.event.inputs.tag }} secrets: dckr_username: ${{ secrets.DOCKER_USER }} dckr_token: ${{ secrets.DOCKER_TOKEN }} - create-releases: + manual-create-releases: if: inputs.pushit - needs: manual-build-matrix + needs: [ prepare-manual-build, manual-build-matrix ] uses: ./.github/workflows/call_release.yml with: - version: ${{ github.event.inputs.version }} \ No newline at end of file + version: ${{ needs.prepare-manual-build.outputs.ete_version }} \ No newline at end of file diff --git a/.github/workflows/pr-context.yml b/.github/workflows/pr-context.yml index ad8edc1..72c8b76 100644 --- a/.github/workflows/pr-context.yml +++ b/.github/workflows/pr-context.yml @@ -3,6 +3,7 @@ name: (Pull Request) Check changes to Context on: pull_request: + types: [ opened, synchronize, reopened ] branches: - master paths: @@ -14,12 +15,9 @@ permissions: jobs: pr-shell-lint: runs-on: ubuntu-latest - steps: - name: Repository checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Differential ShellCheck uses: redhat-plumbers-in-action/differential-shellcheck@v5 diff --git a/.github/workflows/pr-flavor-alpine.yml b/.github/workflows/pr-flavor-alpine.yml index d67ccd1..15ca4d2 100644 --- a/.github/workflows/pr-flavor-alpine.yml +++ b/.github/workflows/pr-flavor-alpine.yml @@ -10,13 +10,11 @@ on: - "tags/alpine/Dockerfile" jobs: - pr-dckr-alpine-stable: + pr-dckr-alpine: + strategy: + matrix: + version: [ "stable", "master" ] uses: ./.github/workflows/call_pr_build.yml with: flavor: "alpine" - - pr-dckr-alpine-master: - uses: ./.github/workflows/call_pr_build.yml - with: - flavor: "alpine" - version: "master" + version: ${{ matrix.version }} diff --git a/.github/workflows/pr-flavor-base.yml b/.github/workflows/pr-flavor-base.yml index a8074ee..c7be225 100644 --- a/.github/workflows/pr-flavor-base.yml +++ b/.github/workflows/pr-flavor-base.yml @@ -10,13 +10,11 @@ on: - "tags/base/Dockerfile" jobs: - pr-dckr-base-stable: + pr-dckr-base: + strategy: + matrix: + version: [ "stable", "master" ] uses: ./.github/workflows/call_pr_build.yml with: flavor: "base" - - pr-dckr-base-master: - uses: ./.github/workflows/call_pr_build.yml - with: - flavor: "base" - version: "master" + version: ${{ matrix.version }} diff --git a/.github/workflows/pr-flavor-slim.yml b/.github/workflows/pr-flavor-slim.yml index a068c4e..7940ba1 100644 --- a/.github/workflows/pr-flavor-slim.yml +++ b/.github/workflows/pr-flavor-slim.yml @@ -10,13 +10,11 @@ on: - "tags/slim/Dockerfile" jobs: - pr-dckr-slim-stable: + pr-dckr-slim: + strategy: + matrix: + version: [ "stable", "master" ] uses: ./.github/workflows/call_pr_build.yml with: flavor: "slim" - - pr-dckr-slim-master: - uses: ./.github/workflows/call_pr_build.yml - with: - flavor: "slim" - version: "master" + version: ${{ matrix.version }} diff --git a/.github/workflows/trigger-new-version.yml b/.github/workflows/trigger-new-version.yml index 62b95a0..9ed1c12 100644 --- a/.github/workflows/trigger-new-version.yml +++ b/.github/workflows/trigger-new-version.yml @@ -9,34 +9,37 @@ on: - "server_version" jobs: - base-new-version: - uses: ./.github/workflows/call_build_push.yml - with: - flavor: "base" - pushit: true - secrets: - dckr_username: ${{ secrets.DOCKER_USER }} - dckr_token: ${{ secrets.DOCKER_TOKEN }} - - slim-new-version: - uses: ./.github/workflows/call_build_push.yml - with: - flavor: "slim" - pushit: true - secrets: - dckr_username: ${{ secrets.DOCKER_USER }} - dckr_token: ${{ secrets.DOCKER_TOKEN }} + prepare-new-version: + runs-on: ubuntu-latest + outputs: + ete_version: ${{ steps.get_version.outputs.version }} + steps: + - name: Checkout Version and Workflow files + uses: actions/checkout@v4 + with: + sparse-checkout: | + server_version + ./.github/actions/get-server-version + sparse-checkout-cone-mode: false + - id: get_version + name: Get Server Version + uses: ./.github/actions/get-server-version + with: + version: ${{ github.event.inputs.version }} - alpine-new-version: - uses: ./.github/workflows/call_build_push.yml + new-version: + needs: prepare-new-version + strategy: + matrix: + flavor: [ "base", "slim", "alpine" ] with: - flavor: "alpine" + flavor: ${{ matrix.flavor }} + version: ${{ needs.prepare-new-version.outputs.ete_version }} pushit: true - platforms: "linux/amd64,linux/arm64" secrets: dckr_username: ${{ secrets.DOCKER_USER }} dckr_token: ${{ secrets.DOCKER_TOKEN }} create-releases: - needs: [base-new-version, slim-new-version, alpine-new-version] + needs: new-version uses: ./.github/workflows/call_release.yml \ No newline at end of file diff --git a/.github/workflows/ztest-trigger-workflow.yml b/.github/workflows/ztest-trigger-workflow.yml deleted file mode 100644 index 237fb74..0000000 --- a/.github/workflows/ztest-trigger-workflow.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -name: (Test) Trigger Workflow - -on: - workflow_dispatch: - inputs: - version: - description: "EteBase Version" - required: false - type: string - platforms: - description: "Set the platforms to build [ linux/amd64, linux/arm64 or linux/arm/v7 ]" - default: "linux/amd64,linux/arm64,linux/arm/v7" - required: false - type: string - tag: - description: "Tag" - required: false - type: string - pushit: - description: "Should push?" - default: false - required: false - type: boolean - -jobs: - test-base-workflow: - uses: ./.github/workflows/call_test_metadata.yml - with: - flavor: "base" - version: ${{ github.event.inputs.version }} - platforms: ${{ github.event.inputs.platforms }} - tag: ${{ github.event.inputs.tag }} - pushit: ${{ github.event.inputs.pushit == 'true' }} - - test-slim-workflow: - uses: ./.github/workflows/call_test_metadata.yml - with: - flavor: "slim" - version: ${{ github.event.inputs.version }} - platforms: ${{ github.event.inputs.platforms }} - tag: ${{ github.event.inputs.tag }} - pushit: ${{ github.event.inputs.pushit == 'true' }} - - test-alpine-workflow: - uses: ./.github/workflows/call_test_metadata.yml - with: - flavor: "alpine" - version: ${{ github.event.inputs.version }} - platforms: ${{ github.event.inputs.platforms }} - tag: ${{ github.event.inputs.tag }} - pushit: ${{ github.event.inputs.pushit == 'true' }} - - test-releases: - if: ${{ github.event.inputs.pushit == 'true' }} - needs: [test-base-workflow, test-slim-workflow, test-alpine-workflow] - uses: ./.github/workflows/call_release.yml - with: - version: ${{ github.event.inputs.version }} \ No newline at end of file diff --git a/.github/workflows/ztest_call_metadata.yml b/.github/workflows/ztest_call_metadata.yml index 1ce7789..5358ae7 100644 --- a/.github/workflows/ztest_call_metadata.yml +++ b/.github/workflows/ztest_call_metadata.yml @@ -4,11 +4,19 @@ name: (Test) Metadata Actions for Dispatch Build on: workflow_call: inputs: - flavor: - description: "Set the base image [base, slim or alpine]" - default: "base" + flavors: + description: "Base images" + default: "base,slim,alpine" required: false - type: string + type: choice + options: + - '[ "base", "slim", "alpine" ]' + - '[ "base", "slim" ]' + - '[ "base", "alpine" ]' + - '[ "slim", "alpine" ]' + - '[ "base" ]' + - '[ "slim" ]' + - '[ "alpine" ]' version: description: "EteBase Version" required: false @@ -29,26 +37,61 @@ on: type: boolean jobs: - test-data: + test-prepare-metadata: runs-on: ubuntu-latest + outputs: + ete_version: ${{ steps.get_version.outputs.version }} steps: - - name: Checkout Dockerfiles and Context + - name: Checkout Version and Workflow files uses: actions/checkout@v4 with: - fetch-depth: 0 + sparse-checkout: | + server_version + ./.github/actions/get-server-version + sparse-checkout-cone-mode: false - - id: server_version + - id: get_version name: Get Server Version uses: ./.github/actions/get-server-version with: - force: ${{ github.event.inputs.version }} + version: ${{ github.event.inputs.version }} + + - id: show_input + run: | + echo '########## inputs ##########' + echo "flavor: ${{ github.event.inputs.flavors }}" + echo "version: ${{ github.event.inputs.version }}" + echo "platforms: ${{ github.event.inputs.platforms }}" + echo "tag: ${{ github.event.inputs.tag }}" + echo "pushit: ${{ github.event.inputs.pushit }}" + + echo '########## ete-version ##########' + echo "ete-version: ${{ steps.get_version.outputs.version }}" + + test-generate-metadata: + needs: test-prepare-metadata + runs-on: ubuntu-latest + strategy: + matrix: + platform: ${{ fromJson(github.event.inputs.platforms) }} + flavor: ${{ fromJson(github.event.inputs.flavors) }} + steps: + - id: checkout + name: Checkout Dockerfiles and Context + uses: actions/checkout@v4 + + - id: process_version + name: Process Version data + uses: ./.github/actions/process-version + with: + version: ${{ needs.test-prepare-metadata.outputs.ete_version }} - id: build_metadata name: Prepare Project Metadata uses: ./.github/actions/build-metadata with: - flavor: ${{ github.event.inputs.flavor }} - version: ${{ steps.server_version.outputs.version }} + flavor: ${{ matrix.flavor }} + version: ${{ steps.process_version.outputs.version }} - id: docker_metadata name: Prepare Docker Metadata @@ -64,51 +107,32 @@ jobs: victorrds/etebase victorrds/etesync flavor: | - latest=${{ ( inputs.flavor == 'base' && steps.server_version.outputs.is_semver == 'true' ) }} + latest=${{ ( matrix.flavor == 'base' && steps.process_version.outputs.is_semver == 'true' ) }} suffix=${{ steps.build_metadata.outputs.suffix }} tags: | - type=edge,branch=${{ steps.build_metadata.outputs.source_name }} - type=raw,value=${{ github.event.inputs.tag }},enable=${{ github.event.inputs.tag != '' }} - type=raw,value=${{ github.event.inputs.flavor }},suffix=,enable=${{ github.event.inputs.tag == '' && steps.server_version.outputs.is_semver == 'true' }} - type=semver,pattern={{version}},value=${{ steps.server_version.outputs.ete_version }},enable=${{ github.event.inputs.tag == '' && steps.server_version.outputs.is_semver == 'true' }} - type=semver,pattern={{major}}.{{minor}},value=${{ steps.server_version.outputs.ete_version }},enable=${{ github.event.inputs.tag == '' && steps.server_version.outputs.is_semver == 'true' }} - + type=edge,enable=${{ inputs.tag != '' }},branch=${{ steps.build_metadata.outputs.source_name }} + type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }} + type=raw,value=${{ matrix.flavor }},suffix=,enable=${{ inputs.tag == '' && steps.process_version.outputs.is_semver == 'true' }} + type=semver,pattern={{version}},value=${{ steps.process_version.outputs.ete_version }},enable=${{ inputs.tag == '' && steps.process_version.outputs.is_semver == 'true' }} + type=semver,pattern={{major}}.{{minor}},value=${{ steps.process_version.outputs.ete_version }},enable=${{ inputs.tag == '' && steps.process_version.outputs.is_semver == 'true' }} - name: Metadata Output shell: bash run: | - echo -e '########## inputs ##########\n' - - echo -e "flavor: ${{ github.event.inputs.flavor }}\n" - - echo -e "version: ${{ github.event.inputs.version }}\n" - - echo -e "platforms: ${{ github.event.inputs.platforms }}\n" - - echo -e "tag: ${{ github.event.inputs.tag }}\n" - - echo -e "pushit: ${{ github.event.inputs.pushit }}\n" - - echo -e "${{ toJson(github.event.inputs) }}" - - echo -e '########## server_version ##########\n' - - echo -e "ete_version: ${{ steps.server_version.outputs.ete_version }}\n" - - echo -e "semver: ${{ steps.server_version.outputs.is_semver }}\n" - - echo -e '########## build_metadata ##########\n' - - echo -e "source_name: ${{ steps.build_metadata.outputs.source_name }}\n" - - echo -e "suffix: ${{ steps.build_metadata.outputs.suffix }}\n" - - echo -e "base_version: ${{ steps.build_metadata.outputs.base_version }}\n" - - echo -e "label_version: ${{ steps.build_metadata.outputs.label_version }}\n" - - echo -e '########## docker_metadata ##########\n' - - echo -e "${{ steps.docker_metadata.outputs.tags }}\n" - - echo -e "${{ steps.docker_metadata.outputs.labels }}\n" + echo '########## server_version ##########' + echo "flavor: ${{ matrix.flavor }}" + echo "flavor: ${{ matrix.platform }}" + + echo '########## server_version ##########' + echo "ete_version: ${{ steps.process_versions.outputs.ete_version }}" + echo "semver: ${{ steps.process_versions.outputs.is_semver }}" + + echo '########## build_metadata ##########' + echo "source_name: ${{ steps.build_metadata.outputs.source_name }}" + echo "suffix: ${{ steps.build_metadata.outputs.suffix }}" + echo "base_version: ${{ steps.build_metadata.outputs.base_version }}" + echo "label_version: ${{ steps.build_metadata.outputs.label_version }}" + + echo '########## docker_metadata ##########' + echo "${{ steps.docker_metadata.outputs.tags }}" + echo "${{ steps.docker_metadata.outputs.labels }}" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6dae992..b1e0ca5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ test examples/production/certs/* .actrc .env -.event.json +.act.*.json .secrets \ No newline at end of file