Fix assets upload url in release workflow #8
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*.*.*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Install goyacc | |
run: go install golang.org/x/tools/cmd/goyacc@latest | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Extract version | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
- name: Build and push operator image | |
env: | |
IMG: fatliverfreddy/cyphernetes-operator:${{ steps.get_version.outputs.VERSION }} | |
run: | | |
make -C operator docker-build IMG=$IMG | |
docker push $IMG | |
docker tag $IMG fatliverfreddy/cyphernetes-operator:latest | |
docker push fatliverfreddy/cyphernetes-operator:latest | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.12.0 | |
- name: Package and push Helm chart | |
run: | | |
helm package operator/helm/cyphernetes-operator | |
echo ${{ secrets.PACKAGES_PUSH_TOKEN }} | helm registry login ghcr.io -u avitaltamir --password-stdin | |
helm push cyphernetes-operator-*.tgz oci://ghcr.io/avitaltamir/cyphernetes | |
- name: Build CLI for all platforms | |
run: | | |
make operator-manifests build-all-platforms-and-archs | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PACKAGES_PUSH_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: true | |
prerelease: false | |
upload-assets: | |
needs: release | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- os: darwin | |
arch: amd64 | |
- os: darwin | |
arch: arm64 | |
- os: linux | |
arch: amd64 | |
- os: linux | |
arch: arm64 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PACKAGES_PUSH_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: ./dist/cyphernetes-${{ matrix.os }}-${{ matrix.arch }} | |
asset_name: cyphernetes-${{ matrix.os }}-${{ matrix.arch }} | |
asset_content_type: application/octet-stream |