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:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
tags: 'v*'
|
||||
|
||||
env:
|
||||
GOOS: windows
|
||||
@ -18,9 +16,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get GoLang version
|
||||
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
|
||||
|
||||
- run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
@ -33,7 +34,21 @@ jobs:
|
||||
- name: Build project
|
||||
run: go build -o build/ -v ./...
|
||||
|
||||
- name: Upload executable
|
||||
uses: actions/upload-artifact@v4
|
||||
- name: Create release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
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