Skip to content

Commit

Permalink
Merge pull request #34 from cybozu-go/migrate-to-ghcr
Browse files Browse the repository at this point in the history
Migrate to ghcr.io
  • Loading branch information
yokaze authored Feb 19, 2024
2 parents db7b3dc + 283ab90 commit bad920b
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 36 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Test
Expand All @@ -23,9 +23,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
- name: Setup go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Lint
Expand All @@ -36,20 +36,20 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: goreleaser/[email protected]
with:
version: v1.21.2
version: v1.23.0
args: check -f .goreleaser.yml
test:
name: Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Test
Expand All @@ -62,7 +62,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make start KUBERNETES_VERSION=${{ matrix.k8s-version }}
Expand All @@ -72,7 +72,7 @@ jobs:
- run: make logs
working-directory: e2e
if: always()
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: logs-${{ matrix.k8s-version }}.tar.gz
Expand All @@ -88,7 +88,7 @@ jobs:
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Setup go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Setup tag for goreleaser
Expand All @@ -97,7 +97,7 @@ jobs:
- name: GoReleaser
uses: goreleaser/[email protected]
with:
version: v1.21.2
version: v1.23.0
args: --snapshot --skip-publish --rm-dist
- name: Test built containers
run: make container-structure-test
8 changes: 4 additions & 4 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.3
version: v3.13.3
- name: Check chart version
run: |
tag_version=${GITHUB_REF##*/chart-v}
Expand All @@ -25,7 +25,7 @@ jobs:
fi
- name: Packaging the chart
run: helm package ./charts/tenet/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: helm-charts
path: ./tenet-*.tgz
Expand All @@ -41,8 +41,8 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.3
- uses: actions/download-artifact@v3
version: v3.13.3
- uses: actions/download-artifact@v4
with:
name: helm-charts
- name: Update charts index
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
- name: Set up chart-testing
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # 2.6.1
- name: Run chart-testing (list-changed)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mdbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: make book
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: book
path: docs/book
Expand All @@ -26,7 +26,7 @@ jobs:
ref: gh-pages
# do not remove helm chart related files if present
- run: ls | grep -v -E "index.yaml|.*\.tgz" | xargs rm -rf
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: book
- run: git add .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: GoReleaser
uses: goreleaser/[email protected]
with:
version: v1.21.2
version: v1.23.0
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ version: login-gh update-kustomize-version ## Update dependent versions
$(call update-version,kubernetes-sigs/kind,KIND_VERSION)
$(call update-version,rust-lang/mdBook,MDBOOK_VERSION)

$(call update-version-quay,cert-manager,CERT_MANAGER_VERSION)
$(call update-version-quay,cilium,CILIUM_VERSION)
$(call update-version-ghcr,cert-manager,CERT_MANAGER_VERSION)
$(call update-version-ghcr,cilium,CILIUM_VERSION)

.PHONY: update-kustomize-version
update-kustomize-version:
$(call get-latest-quay-tag,argocd)
NEW_VERSION=$$(docker run quay.io/cybozu/argocd:$(latest_tag) kustomize version | cut -c2-); \
$(call get-latest-gh-package-tag,argocd)
NEW_VERSION=$$(docker run ghcr.io/cybozu/argocd:$(latest_tag) kustomize version | cut -c2-); \
sed -i -e "s/KUSTOMIZE_VERSION := .*/KUSTOMIZE_VERSION := $${NEW_VERSION}/g" Makefile.versions

.PHONY: update-actions
Expand Down Expand Up @@ -272,9 +272,9 @@ define get-latest-gh
$(eval latest_gh := $(shell $(GH) release list --repo $1 | grep Latest | cut -f3))
endef

# usage: get-latest-quay-tag NAME
define get-latest-quay-tag
$(eval latest_tag := $(shell wget -O - https://quay.io/api/v1/repository/cybozu/$1/tag/ | jq -r '.tags[] | .name' | awk '/.*\..*\./ {print $$1; exit}'))
# usage: get-latest-gh-package-tag NAME
define get-latest-gh-package-tag
$(eval latest_tag := $(shell curl -sSf -H "Authorization: Bearer $(shell curl -sSf "https://ghcr.io/token?scope=repository%3Acybozu%2F$1%3Apull&service=ghcr.io" | jq -r .token)" https://ghcr.io/v2/cybozu/$1/tags/list | jq -r '.tags[]' | sort -Vr | head -n 1))
endef

# usage: get-release-hash OWNER/REPO VERSION
Expand All @@ -300,9 +300,9 @@ define update-version
sed -i -e "s/^$2 := .*/$2 := $${NEW_VERSION}/g" Makefile.versions
endef

# usage: update-version-quay NAME VAR
define update-version-quay
$(call get-latest-quay-tag,$1)
# usage: update-version-ghcr NAME VAR
define update-version-ghcr
$(call get-latest-gh-package-tag,$1)
NEW_VERSION=$$(echo $(call upstream-tag,$(latest_tag)) | cut -b 2-); \
sed -i -e "s/$2 := .*/$2 := $${NEW_VERSION}/g" Makefile.versions
endef
Expand Down
14 changes: 7 additions & 7 deletions Makefile.versions
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ACTIONS_CHECKOUT_VERSION := 4
ACTIONS_DOWNLOAD_ARTIFACT_VERSION := 3
ACTIONS_SETUP_GO_VERSION := 4
ACTIONS_SETUP_PYTHON_VERSION := 4
ACTIONS_UPLOAD_ARTIFACT_VERSION := 3
ACTIONS_DOWNLOAD_ARTIFACT_VERSION := 4
ACTIONS_SETUP_GO_VERSION := 5
ACTIONS_SETUP_PYTHON_VERSION := 5
ACTIONS_UPLOAD_ARTIFACT_VERSION := 4
AZURE_SETUP_HELM_VERSION := 3
CILIUM_VERSION := 1.13.7
CERT_MANAGER_VERSION := 1.13.2
Expand All @@ -12,15 +12,15 @@ DOCKER_LOGIN_VERSION := 3
DOCKER_SETUP_BUILDX_VERSION := 3
DOCKER_SETUP_QEMU_VERSION := 3
GH_VERSION := 2.34.0
GORELEASER_VERSION := 1.22.1
GORELEASER_VERSION := 1.23.0
GORELEASER_ACTION_VERSION := 5.0.0
HELM_CHART_TESTING_VESRION := 2.6.1
HELM_CHART_TESTING_HASH := e6669bcd63d7cb57cb4380c33043eebe5d111992
HELM_KIND_VERSION := 1.8.0
HELM_KIND_HASH := dda0770415bac9fc20092cacbc54aa298604d140
HELM_VERSION := 3.13.2
HELM_VERSION := 3.14.0
KIND_VERSION := 0.20.0
KUBERNETES_VERSION := 1.28.0
KUSTOMIZE_VERSION := 5.1.0
MDBOOK_VERSION := 0.4.35
MDBOOK_VERSION := 0.4.36
YQ_VERSION := 4.35.1

0 comments on commit bad920b

Please sign in to comment.