mirror of
https://github.com/SagerNet/sing-geosite.git
synced 2026-06-24 13:54:18 +08:00
Update workflow output usage
This commit is contained in:
parent
72ca5a6f5e
commit
840236ecc4
3
.github/workflows/build.yaml
vendored
3
.github/workflows/build.yaml
vendored
@ -1,5 +1,6 @@
|
||||
name: Build
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
@ -15,7 +16,7 @@ jobs:
|
||||
- name: Get latest go version
|
||||
id: version
|
||||
run: |
|
||||
echo ::set-output name=go_version::$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')
|
||||
echo "go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')" >> $GITHUB_OUTPUT
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
|
||||
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@ -15,7 +15,7 @@ jobs:
|
||||
- name: Get latest go version
|
||||
id: version
|
||||
run: |
|
||||
echo ::set-output name=go_version::$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')
|
||||
echo "go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')" >> $GITHUB_OUTPUT
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
|
||||
5
main.go
5
main.go
@ -186,7 +186,10 @@ func generate(release *github.RepositoryRelease, output string) error {
|
||||
}
|
||||
|
||||
func setActionOutput(name string, content string) {
|
||||
os.Stdout.WriteString("::set-output name=" + name + "::" + content + "\n")
|
||||
f, err := os.OpenFile(os.Getenv("GITHUB_OUTPUT"), os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
|
||||
common.Must(err)
|
||||
defer f.Close()
|
||||
common.Must1(f.WriteString(name + "=" + content + "\n"))
|
||||
}
|
||||
|
||||
func release(source string, destination string, output string) error {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user