name: release on: push: tags: - 'v*' jobs: build-push: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Prepare id: prep run: | VERSION=$(grep 'VERSION' pkg/version/version.go | awk '{ print $4 }' | tr -d '"') CHANGELOG="https://github.com/fluxcd/flagger/blob/main/CHANGELOG.md#$(echo $VERSION | tr -d '.')" echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ') echo ::set-output name=VERSION::${VERSION} echo ::set-output name=CHANGELOG::${CHANGELOG} - name: Setup QEMU uses: docker/setup-qemu-action@v1 with: platforms: all - name: Setup Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 with: buildkitd-flags: "--debug" - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: registry: ghcr.io username: fluxcdbot password: ${{ secrets.GHCR_TOKEN }} - name: Publish image uses: docker/build-push-action@v2 with: push: true builder: ${{ steps.buildx.outputs.name }} context: . file: ./Dockerfile platforms: linux/amd64,linux/arm64,linux/arm/v7 build-args: | REVISON=${{ github.sha }} tags: | ghcr.io/fluxcd/flagger:${{ steps.prep.outputs.VERSION }} labels: | org.opencontainers.image.title=${{ github.event.repository.name }} org.opencontainers.image.description=${{ github.event.repository.description }} org.opencontainers.image.url=${{ github.event.repository.html_url }} org.opencontainers.image.source=${{ github.event.repository.html_url }} org.opencontainers.image.revision=${{ github.sha }} org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }} org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }} - name: Check images run: | docker buildx imagetools inspect ghcr.io/fluxcd/flagger:${{ steps.prep.outputs.VERSION }} - name: Publish Helm charts uses: stefanprodan/helm-gh-pages@master with: token: ${{ secrets.GITHUB_TOKEN }} charts_url: https://flagger.app - name: Create release uses: actions/create-release@latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} draft: false prerelease: false body: | [CHANGELOG](${{ steps.prep.outputs.CHANGELOG }})