Skip to content

Release 0.6.0

Release 0.6.0 #339

Workflow file for this run

name: Test
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
schedule:
- cron: '0 15 * * 5'
jobs:
test:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Prepare
run: |
sudo apt-get update -qq
sudo apt-get install -y tftp-hpa asciidoctor
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build
run: |
make
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::665474295387:role/gha-s3tftpd
aws-region: us-east-2
- name: Unit test
run: |
make test
- name: Integration test
run: |
bundle exec rspec
env:
TEST_BUCKET_NAME: hanazuki-s3tftpd-test
docker-build:
strategy:
matrix:
include:
- runner: ubuntu-24.04
platforms: linux/amd64
- runner: ubuntu-24.04-arm
platforms: linux/arm64,linux/arm/v7
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
steps:
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- id: build-push
uses: docker/build-push-action@v5
with:
platforms: ${{ matrix.platforms }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
outputs: type=image,name=ghcr.io/hanazuki/s3tftpd,push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Export digests
run: |
mkdir -p "${RUNNER_TEMP}/digests"
printenv DIGEST > "${RUNNER_TEMP}/digests/${RUNNER}"
env:
RUNNER_TEMP: ${{ runner.temp }}
DIGEST: ${{ steps.build-push.outputs.digest }}
RUNNER: ${{ matrix.runner }}
- name: Upload digests'
uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.runner }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
docker-merge:
needs:
- test
- docker-build
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true
- shell: bash
run: |
tags=(--dry-run)
if [[ $GITHUB_EVENT_NAME == push ]]; then
if [[ $GITHUB_REF == refs/heads/master ]]; then
tags=(-t "${REPO}:${SHA}" -t "${REPO}:testing")
elif [[ $GITHUB_REF == refs/tags/v* ]]; then
tags=(-t "${REPO}:${GITHUB_REF#refs/tags/v}" -t "${REPO}:latest")
fi
fi
annotations=(
--annotation "index:org.opencontainers.image.revision=${SHA}"
--annotation "index:org.opencontainers.image.source=${SRC}"
)
cat "${RUNNER_TEMP}"/digests/* | xargs -I{} printf "%s@%s\n" "${REPO}" {} | xargs docker buildx imagetools create "${tags[@]}" "${annotations[@]}"
env:
RUNNER_TEMP: ${{ runner.temp }}
REPO: ghcr.io/${{ github.repository }}
SHA: ${{ github.sha }}
SRC: ${{ github.event.repository.html_url }}