Upload_release #85
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: Upload_release | |
on: | |
workflow_dispatch: | |
inputs: | |
url: | |
description: 'github release url' | |
required: true | |
tag: | |
description: 'latest tag' | |
required: true | |
jobs: | |
build: | |
name: Create Release | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [ darwin, windows, linux ] | |
arch: [ amd64, arm64, 386 ] | |
exclude: | |
- os: darwin | |
arch: 386 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20' | |
check-latest: true | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build kubevpn | |
run: | | |
git tag ${{ github.event.inputs.tag }} || true | |
export GitHubOAuthToken=${{ secrets.KUBEVPN_UPGRADE_OAUTH }} | |
make kubevpn-${{ matrix.os }}-${{ matrix.arch }} | |
SUFFIX="" | |
if [ "${{ matrix.os }}" = "windows" ]; then | |
SUFFIX=".exe" | |
fi | |
shasum -a 256 ./bin/kubevpn${SUFFIX} | awk '{print $1}' > checksums.txt | |
zip -r kubevpn_${{ github.event.inputs.tag }}_${{ matrix.os }}_${{ matrix.arch }}.zip ./bin/kubevpn${SUFFIX} LICENSE README.md README_ZH.md checksums.txt | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.inputs.url }} | |
asset_path: ./kubevpn_${{ github.event.inputs.tag }}_${{ matrix.os }}_${{ matrix.arch }}.zip | |
asset_name: kubevpn_${{ github.event.inputs.tag }}_${{ matrix.os }}_${{ matrix.arch }}.zip | |
asset_content_type: application/zip | |