move all jobs to GHA and retire CircleCI #42
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build: | |
uses: ./.github/workflows/build.yml | |
release-build: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.23" | |
cache-dependency-path: go.sum | |
- name: Installing Dependencies | |
run: make deps | |
- name: Build release | |
run: make release-build | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-artifacts | |
path: build | |
github-release: | |
runs-on: ubuntu-latest | |
needs: release-build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: release-artifacts | |
path: build | |
- name: Push to github | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create $(cat ./build/VERSION) \ | |
--title $(cat ./build/VERSION) \ | |
--notes-file ./build/CHANGELOG \ | |
./build/release/* | |
- name: Update coverage badge | |
uses: ncruces/go-coverage-report@main | |
with: | |
report: true | |
chart: true | |
amend: true | |
docker-image: | |
runs-on: ubuntu-latest | |
needs: release-build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: release-artifacts | |
path: build | |
- name: Retrieve release tag to build | |
run: | | |
echo "REL_TAG=$(cat ./build/VERSION)" >> ${GITHUB_ENV} | |
- name: Log into Docker Hub | |
uses: docker/login-action@v3.3.0 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Log into GitHub Container Registry | |
uses: docker/login-action@v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push to docker hub and ghcr.io | |
env: | |
PLATFORM: linux/amd64,linux/arm64,linux/arm | |
run: | | |
docker context create multi-platform | |
docker run --privileged --rm tonistiigi/binfmt --install all | |
docker buildx create multi-platform --platform ${{ env.PLATFORM }} --use | |
docker buildx build --progress plain \ | |
-f package/container/Dockerfile --push \ | |
--platform ${{ env.PLATFORM }} \ | |
-t hangxie/parquet-tools:${{ env.REL_TAG }} \ | |
-t hangxie/parquet-tools:latest \ | |
-t ghcr.io/hangxie/parquet-tools:${{ env.REL_TAG }} \ | |
-t ghcr.io/hangxie/parquet-tools:latest \ | |
. |