Upload_release #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: 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.21' | |
check-latest: true | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build sshvpn | |
run: | | |
git tag ${{ github.event.inputs.tag }} || true | |
make sshvpn-${{ matrix.os }}-${{ matrix.arch }} | |
SUFFIX="" | |
if [ "${{ matrix.os }}" = "windows" ]; then | |
SUFFIX=".exe" | |
fi | |
shasum -a 256 ./bin/sshvpn${SUFFIX} | awk '{print $1}' > checksums.txt | |
zip -r sshvpn_${{ github.event.inputs.tag }}_${{ matrix.os }}_${{ matrix.arch }}.zip ./bin/sshvpn${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: ./sshvpn_${{ github.event.inputs.tag }}_${{ matrix.os }}_${{ matrix.arch }}.zip | |
asset_name: sshvpn_${{ github.event.inputs.tag }}_${{ matrix.os }}_${{ matrix.arch }}.zip | |
asset_content_type: application/zip | |