mirror of
https://github.com/Baipyrus/ProxySwitcher.git
synced 2024-12-26 12:41:45 +00:00
uploading build artifact on tag in releases
This commit is contained in:
parent
da23ed7440
commit
8db311cb99
31
.github/workflows/build.yml
vendored
31
.github/workflows/build.yml
vendored
@ -5,9 +5,7 @@ name: Go
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
tags: 'v*'
|
||||||
pull_request:
|
|
||||||
branches: [ "main" ]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GOOS: windows
|
GOOS: windows
|
||||||
@ -18,9 +16,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
|
- name: Get GoLang version
|
||||||
|
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
@ -33,7 +34,21 @@ jobs:
|
|||||||
- name: Build project
|
- name: Build project
|
||||||
run: go build -o build/ -v ./...
|
run: go build -o build/ -v ./...
|
||||||
|
|
||||||
- name: Upload executable
|
- name: Create release
|
||||||
uses: actions/upload-artifact@v4
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
path: build/ProxySwitcher.exe
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: Release ${{ github.ref }}
|
||||||
|
|
||||||
|
- name: Upload executable
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: build/ProxySwitcher.exe
|
||||||
|
asset_name: ProxySwitcher.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
Loading…
Reference in New Issue
Block a user