diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 59bc948ae..000000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,30 +0,0 @@ -name-template: 'v$RESOLVED_VERSION' -tag-template: 'v$RESOLVED_VERSION' - -template: | - ## General Changes - - $CHANGES - -categories: -- title: '🚀 Features' - labels: - - 'feature' - - 'enhancement' -- title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - -version-resolver: - major: - labels: - - 'major' - minor: - labels: - - 'minor' - patch: - labels: - - 'patch' - default: patch diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..27163e56f --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,24 @@ +--- +name: metal-stack component release + +on: + pull_request: + branches: + - master + release: + types: + - published + push: + branches: + - master + +jobs: + draft: + uses: metal-stack/actions-common/.github/workflows/release-drafter.yaml@v1 + + go-build: + uses: metal-stack/actions-common/.github/workflows/go-build.yaml@v1 + secrets: inherit + with: + build-command: make release + test-command: make test-integration diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index e488efbeb..000000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,79 +0,0 @@ ---- -name: Docker Build Action -on: - pull_request: - branches: - - master - release: - types: - - published - push: - branches: - - master - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build: - name: Docker Build - runs-on: ubuntu-latest - - steps: - - name: Log in to the container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ secrets.DOCKER_REGISTRY_USER }} - password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} - - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Go - uses: actions/setup-go@v6 - with: - go-version-file: 'go.mod' - cache: false - - - name: Lint - uses: golangci/golangci-lint-action@v9 - with: - args: --build-tags integration -D protogetter --timeout=5m - - - name: Make tag - run: | - [ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true - [ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "tag=${GITHUB_REF##*/}" >> $GITHUB_ENV || true - [ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=latest" >> $GITHUB_ENV || true - - - name: Build - run: | - make release - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Push image - uses: docker/build-push-action@v6 - with: - context: . - push: true - sbom: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.tag }} - - integration: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Go - uses: actions/setup-go@v6 - with: - go-version-file: 'go.mod' - - - name: Run integration tests - run: | - make test-integration diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml deleted file mode 100644 index f0e8eae2c..000000000 --- a/.github/workflows/release-drafter.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: Release Drafter Action - -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: release-drafter/release-drafter@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/cmd/metal-api/internal/datastore/image_test.go b/cmd/metal-api/internal/datastore/image_test.go index d8021594d..5676fe615 100644 --- a/cmd/metal-api/internal/datastore/image_test.go +++ b/cmd/metal-api/internal/datastore/image_test.go @@ -306,7 +306,7 @@ func TestRethinkStore_DeleteOrphanImages(t *testing.T) { ubuntu17_04 := metal.Image{Base: metal.Base{ID: "ubuntu-17.4"}, OS: "ubuntu", Version: "17.4", ExpirationDate: valid} ubuntu17_10 := metal.Image{Base: metal.Base{ID: "ubuntu-17.10"}, OS: "ubuntu", Version: "17.10", ExpirationDate: valid} ubuntu18_04 := metal.Image{Base: metal.Base{ID: "ubuntu-18.4"}, OS: "ubuntu", Version: "18.4", ExpirationDate: valid} - ubuntu19_04 := metal.Image{Base: metal.Base{ID: "ubuntu-19.4"}, OS: "ubuntu", Version: "19.4", ExpirationDate: invalid} // not allocated + ubuntu19_04 := metal.Image{Base: metal.Base{ID: "ubuntu-19.4"}, OS: "ubuntu", Version: "19.4", ExpirationDate: invalid} // not allocated ubuntu19_10 := metal.Image{Base: metal.Base{ID: "ubuntu-19.10"}, OS: "ubuntu", Version: "19.10", ExpirationDate: invalid} // allocated alpine3_9 := metal.Image{Base: metal.Base{ID: "alpine-3.9"}, OS: "alpine", Version: "3.9", ExpirationDate: invalid} // not allocated alpine3_10 := metal.Image{Base: metal.Base{ID: "alpine-3.10"}, OS: "alpine", Version: "3.10", ExpirationDate: invalid} // not allocated but kept because last from that os