Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix monthly scheduled tasks workflow #1465

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 176 additions & 8 deletions .github/workflows/scheduled-monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,185 @@ jobs:
run: |
echo "${{ steps.git-describe-semver.outputs.version }}"

build_all_images_using_makefile:
name: Build all images using Makefile

build_and_upload_mirror_images:
name: Build and upload mirror container images
needs: git_describe_semver

# https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
contents: write
discussions: write
packages: write

if: startsWith(github.ref, 'refs/tags')

runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 45

steps:
- name: Print Docker version
run: docker --version
- name: Log tag info
run: |
echo "Ref type: ${{ github.ref_type }}"
echo "Ref name: ${{ github.ref_name }}"
echo "Ref full: ${{ github.ref }}"
echo "Commit SHA: ${{ github.sha }}"

- name: Check out code with default settings
uses: actions/checkout@v4

# Mark the current working directory as a safe directory in git to
# resolve "dubious ownership" complaints.
#
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
# https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html
# https://github.com/actions/runner-images/issues/6775
# https://github.com/actions/checkout/issues/766
- name: Mark the current working directory as a safe directory in git
# run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
run: git config --global --add safe.directory "${PWD}"

# bsdmainutils provides "column" which is used by the Makefile
- name: Install Ubuntu packages
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends make gcc bsdmainutils

- name: Build mirror images
env:
REPO_VERSION: ${{ needs.git_describe_semver.outputs.version }}
run: |
make build-mirror-images

- name: List generated Docker images
run: docker image ls --filter "label=atc0005.go-ci" --format "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.Size}}"

build_and_upload_alpine_images:
name: Build and upload Alpine container images
needs: git_describe_semver

# https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
contents: write
discussions: write
packages: write

if: startsWith(github.ref, 'refs/tags')

runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 45

steps:
- name: Log tag info
run: |
echo "Ref type: ${{ github.ref_type }}"
echo "Ref name: ${{ github.ref_name }}"
echo "Ref full: ${{ github.ref }}"
echo "Commit SHA: ${{ github.sha }}"

- name: Check out code with default settings
uses: actions/checkout@v4

# Mark the current working directory as a safe directory in git to
# resolve "dubious ownership" complaints.
#
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
# https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html
# https://github.com/actions/runner-images/issues/6775
# https://github.com/actions/checkout/issues/766
- name: Mark the current working directory as a safe directory in git
# run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
run: git config --global --add safe.directory "${PWD}"

# bsdmainutils provides "column" which is used by the Makefile
- name: Install Ubuntu packages
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends make gcc bsdmainutils

- name: Build Alpine images
env:
REPO_VERSION: ${{ needs.git_describe_semver.outputs.version }}
run: |
make build-alpine-images

- name: List generated Docker images
run: docker image ls --filter "label=atc0005.go-ci" --format "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.Size}}"

build_and_upload_mingw_images:
name: Build and upload mingw-w64 container images
needs: git_describe_semver

# https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
contents: write
discussions: write
packages: write

if: startsWith(github.ref, 'refs/tags')

runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 45

steps:
- name: Log tag info
run: |
echo "Ref type: ${{ github.ref_type }}"
echo "Ref name: ${{ github.ref_name }}"
echo "Ref full: ${{ github.ref }}"
echo "Commit SHA: ${{ github.sha }}"

- name: Check out code with default settings
uses: actions/checkout@v4

# Mark the current working directory as a safe directory in git to
# resolve "dubious ownership" complaints.
#
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
# https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html
# https://github.com/actions/runner-images/issues/6775
# https://github.com/actions/checkout/issues/766
- name: Mark the current working directory as a safe directory in git
# run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
run: git config --global --add safe.directory "${PWD}"

# bsdmainutils provides "column" which is used by the Makefile
- name: Install Ubuntu packages
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends make gcc bsdmainutils

- name: Build mingw-w64 images
env:
REPO_VERSION: ${{ needs.git_describe_semver.outputs.version }}
run: |
make build-mingw-images

- name: List generated Docker images
run: docker image ls --filter "label=atc0005.go-ci" --format "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.Size}}"

build_and_upload_standard_images:
name: Build and upload standard container images
needs: git_describe_semver

# https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
contents: write
discussions: write
packages: write

if: startsWith(github.ref, 'refs/tags')

runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 45

steps:
- name: Log tag info
run: |
echo "Ref type: ${{ github.ref_type }}"
echo "Ref name: ${{ github.ref_name }}"
echo "Ref full: ${{ github.ref }}"
echo "Commit SHA: ${{ github.sha }}"

- name: Clone repo with default settings
- name: Check out code with default settings
uses: actions/checkout@v4

# Mark the current working directory as a safe directory in git to
Expand All @@ -100,10 +267,11 @@ jobs:
- name: Install Ubuntu packages
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends make gcc bsdmainutils

- name: Build images using project Makefile
- name: Build standard images
env:
REPO_VERSION: ${{ needs.git_describe_semver.outputs.version }}
run: |
export REPO_VERSION=${{ needs.git_describe_semver.outputs.version }}
make build
make build-standard-images

- name: List generated Docker images
run: docker image ls --filter "label=atc0005.go-ci" --format "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.Size}}"