Merge pull request #28 from cybozu-go/bump-version-to-0.3.0 #4
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*" | |
| jobs: | |
| image-build: | |
| name: Push Container Image | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get version | |
| id: get_version | |
| run: | | |
| version=${GITHUB_REF#refs/tags/v} | |
| echo "result=${version}" >> $GITHUB_OUTPUT | |
| - uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: linux/amd64 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ofen image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: dockerfiles/Dockerfile.imageprefetch-controller | |
| push: true | |
| tags: | | |
| ghcr.io/cybozu-go/ofen:${{steps.get_version.outputs.result}} | |
| - name: Build and push ofend image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: dockerfiles/Dockerfile.nodeimageset-controller | |
| push: true | |
| tags: | | |
| ghcr.io/cybozu-go/ofend:${{steps.get_version.outputs.result}} | |
| release: | |
| name: Release on GitHub | |
| needs: image-build | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/} # Don't remove "v" prefix. | |
| if echo ${VERSION} | grep -q -e '-'; then PRERELEASE_FLAG=-p; fi | |
| gh release create $VERSION $PRERELEASE_FLAG \ | |
| -t "Release $VERSION" \ | |
| --generate-notes | |
| chart-release: | |
| permissions: | |
| contents: write | |
| runs-on: "ubuntu-24.04" | |
| needs: release | |
| if: contains(needs.release.result, 'success') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create release notes | |
| env: | |
| tag_version: ${{ github.ref_name }} | |
| run: | | |
| cat <<EOF > ./charts/ofen/RELEASE.md | |
| Helm chart for ofen [$tag_version](https://github.com/cybozu-go/ofen/releases/tag/$tag_version) | |
| EOF | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| - name: Run chart-releaser | |
| uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0 | |
| with: | |
| config: "cr.yaml" | |
| env: | |
| CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |