hotfix: fix port-forward retry bug (#366) #202
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: | |
build: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
check-latest: true | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Push image to docker hub | |
run: | | |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
docker buildx create --use | |
make container | |
- name: Release Note | |
run: | | |
RELEASE_VERSION=${GITHUB_REF#refs/*/} | |
PREVERSION=$(git for-each-ref --sort='-creatordate' --format='%(refname:lstrip=2)' --count=50 'refs/tags/*' | grep -v 'rc' | awk 'NR==2') | |
echo ${PREVERSION} | |
echo ${PREVERSION} | |
echo "$(./.github/release-note.sh ${PREVERSION} ${RELEASE_VERSION})" > release_note.md | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
body_path: release_note.md | |
- name: Collect Release Info | |
run: | | |
echo "${{ steps.create_release.outputs.upload_url }}" >> UPLOAD_URL | |
echo ${{ env.RELEASE_VERSION }} >> RELEASE_VERSION | |
git reset --hard | |
- name: Upload RELEASE_VERSION | |
uses: actions/upload-artifact@v4 | |
with: | |
name: RELEASE_VERSION | |
path: RELEASE_VERSION | |
- name: Upload UPLOAD_URL | |
uses: actions/upload-artifact@v4 | |
with: | |
name: UPLOAD_URL | |
path: UPLOAD_URL | |
- name: Repository Dispatch | |
uses: aurelien-baudet/workflow-dispatch@v2 | |
with: | |
workflow: Upload_release | |
token: ${{ secrets.REPOSITORYDISPATCH }} | |
inputs: '{"url": "${{ steps.create_release.outputs.upload_url }}", "tag": "${{ github.ref_name }}"}' | |
- name: Make changes to pull request | |
run: make version && echo ${GITHUB_REF#refs/*/} > plugins/stable.txt | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
add-paths: | | |
*.yaml | |
plugins/stable.txt | |
token: ${{ secrets.REPOSITORYDISPATCH }} | |
commit-message: "feat: update krew index version to ${{ github.ref }}" | |
committer: GitHub <noreply@github.com> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
signoff: false | |
branch: feat/update-krew-index-version | |
base: master | |
delete-branch: true | |
title: 'feat: update krew index version to ${{ github.ref }}' | |
body: | | |
update report | |
- update with *today's* date | |
- update krew index version to ${{ github.ref }} | |
labels: | | |
report | |
automated pr | |
draft: false | |
release-helm-chart: | |
name: Release KubeVPN Helm Chart | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
check-latest: true | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Helm tool installer | |
uses: azure/setup-helm@v4 | |
with: | |
version: "v3.6.3" | |
- name: Change chart version | |
run: | | |
VERSION=${GITHUB_REF#refs/*/} | |
CHART_VERSION=${VERSION/#v/} | |
sed -i "s/^appVersion:.*$/appVersion: \"${VERSION}\"/;s/^version:.*$/version: ${CHART_VERSION}/" charts/kubevpn/Chart.yaml | |
sed -i "s/tag:.*$/tag: \"${VERSION}\"/" charts/kubevpn/values.yaml | |
- name: Tar chart | |
run: | | |
VERSION=${GITHUB_REF#refs/*/} | |
CHART_VERSION=${VERSION/#v/} | |
tar --transform 's/^charts\/kubevpn/kubevpn/' -zcf kubevpn-${CHART_VERSION}.tgz charts/kubevpn | |
shasum -a 256 kubevpn-${CHART_VERSION}.tgz | awk '{print $1}' > kubevpn-${CHART_VERSION}.tgz-SHA256 | |
- name: Download UPLOAD_URL | |
uses: actions/download-artifact@v4 | |
with: | |
name: UPLOAD_URL | |
- name: Get Release UPLOAD_URL | |
id: get_release_info | |
run: | | |
UploadUrl=$(cat ./UPLOAD_URL) | |
echo "::set-output name=upload_url::$UploadUrl" | |
- name: Get assert name | |
id: get_assert_info | |
run: | | |
VERSION=${GITHUB_REF#refs/*/} | |
CHART_VERSION=${VERSION/#v/} | |
AssertName=kubevpn-${CHART_VERSION}.tgz | |
echo "::set-output name=assert_name::$AssertName" | |
- name: Get assert SHA256 name | |
id: get_assert_info_sha256 | |
run: | | |
VERSION=${GITHUB_REF#refs/*/} | |
CHART_VERSION=${VERSION/#v/} | |
AssertName=kubevpn-${CHART_VERSION}.tgz-SHA256 | |
echo "::set-output name=assert_name::$AssertName" | |
- name: Upload Release Asset KubeVPN Server Chart | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | |
asset_path: ${{ steps.get_assert_info.outputs.assert_name }} | |
asset_name: ${{ steps.get_assert_info.outputs.assert_name }} | |
asset_content_type: application/octet-stream | |
- name: Upload Release Asset KubeVPN Chart SHA256 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | |
asset_path: ${{ steps.get_assert_info_sha256.outputs.assert_name }} | |
asset_name: ${{ steps.get_assert_info_sha256.outputs.assert_name }} | |
asset_content_type: application/octet-stream | |
github-pages-deploy: | |
name: Release Helm Chart To branch master | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
needs: release-helm-chart | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
check-latest: true | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
- name: Change chart version | |
run: | | |
VERSION=${GITHUB_REF#refs/*/} | |
CHART_VERSION=${VERSION/#v/} | |
sed -i "s/^appVersion:.*$/appVersion: \"${VERSION}\"/;s/^version:.*$/version: ${CHART_VERSION}/" charts/kubevpn/Chart.yaml | |
sed -i "s/tag:.*$/tag: \"${VERSION}\"/" charts/kubevpn/values.yaml | |
- name: Package and upload helm chart | |
run: | | |
# download helm chart releaser | |
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 | |
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY") | |
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY") | |
# package chart | |
./cr package charts/$repo | |
# update index and push to github pages | |
git config user.email "$owner@users.noreply.github.com" | |
git config user.name "$owner" | |
./cr index \ | |
--owner "$owner" \ | |
--git-repo "$repo" \ | |
--token "${{ secrets.CREATE_HELM_PR }}" \ | |
--release-name-template "v{{ .Version }}" \ | |
--index-path ./index.yaml \ | |
--charts-repo https://github.com/$owner/$repo \ | |
--pages-branch master \ | |
--pages-index-path charts/index.yaml \ | |
--push |