Bump version to 0.2.2 (#370) #20
Workflow file for this run
This file contains hidden or 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*" | |
| permissions: read-all | |
| jobs: | |
| build-and-publish-images: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract tag name | |
| id: extract_tag_name | |
| run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Build and push clowarden-dbmigrator image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| file: database/migrations/Dockerfile | |
| tags: ghcr.io/${{ github.repository }}/dbmigrator:${{steps.extract_tag_name.outputs.tag}},ghcr.io/${{ github.repository }}/dbmigrator:latest | |
| push: true | |
| labels: | | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.description=CLOWarden database migrator | |
| org.opencontainers.image.licenses=Apache-2.0 | |
| - name: Build and push clowarden-server image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| file: clowarden-server/Dockerfile | |
| tags: ghcr.io/${{ github.repository }}/server:${{steps.extract_tag_name.outputs.tag}},ghcr.io/${{ github.repository }}/server:latest | |
| push: true | |
| labels: | | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.description=CLOWarden server | |
| org.opencontainers.image.licenses=Apache-2.0 | |
| package-and-publish-helm-chart: | |
| needs: | |
| - build-and-publish-images | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "[email protected]" | |
| - name: Install Helm | |
| uses: azure/setup-helm@v4 | |
| - name: Run chart-releaser | |
| run: | | |
| # From: https://github.com/metallb/metallb/blob/293f43c1f78ab1b5fa8879a76746b094bd9dd3ca/.github/workflows/publish.yaml#L134-L163 | |
| # Ref: https://github.com/helm/chart-releaser-action/issues/60 | |
| curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/v1.6.1/chart-releaser_1.6.1_linux_amd64.tar.gz" | |
| tar -xzf cr.tar.gz | |
| rm -f cr.tar.gz | |
| repo=$(basename "$GITHUB_REPOSITORY") | |
| owner=$(dirname "$GITHUB_REPOSITORY") | |
| tag="${GITHUB_REF_NAME:1}" | |
| exists=$(curl -s -H "Accept: application/vnd.github.v3+json" https://github.com/$GITHUB_REPOSITORY/releases/tag/$repo-chart-$tag -w %{http_code} -o /dev/null) | |
| if [[ $exists != "200" ]]; then | |
| echo "Creating release..." | |
| # package chart | |
| ./cr package charts/$repo | |
| # upload chart to github releases | |
| ./cr upload \ | |
| --owner "$owner" \ | |
| --git-repo "$repo" \ | |
| --release-name-template "{{ .Name }}-chart-{{ .Version }}" \ | |
| --token "${{ secrets.GITHUB_TOKEN }}" | |
| # Update index and push to github pages | |
| ./cr index \ | |
| --owner "$owner" \ | |
| --git-repo "$repo" \ | |
| --index-path index.yaml \ | |
| --release-name-template "{{ .Name }}-chart-{{ .Version }}" \ | |
| --push | |
| else | |
| echo "Release already exists" | |
| fi |