Skip to content

Commit ac05973

Browse files
Update go.yml
1 parent 321b6f4 commit ac05973

File tree

1 file changed

+35
-15
lines changed

1 file changed

+35
-15
lines changed

.github/workflows/go.yml

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,45 @@
1-
# This workflow will build a golang project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
1+
name: Go package
32

4-
name: Go
5-
6-
on:
7-
push:
8-
branches: [ "master" ]
9-
pull_request:
10-
branches: [ "master" ]
3+
on: [push]
114

125
jobs:
13-
146
build:
7+
158
runs-on: ubuntu-latest
169
steps:
1710
- uses: actions/checkout@v3
18-
- name: Setup Go
11+
12+
- name: Set up Go
1913
uses: actions/setup-go@v4
2014
with:
21-
go-version: '1.16.x'
22-
- name: Install dependencies
23-
run: |
24-
go get -u github.com/spf13/cobra/cobra
15+
go-version: '1.15'
16+
17+
- name: Build
18+
run: go build -v ./...
19+
20+
- name: Test
21+
run: go test -v ./...
22+
23+
- name: Upload a Build Artifact
24+
uses: actions/upload-artifact@v3.1.2
25+
with:
26+
# Artifact name
27+
name: staticsitegenerator
28+
# A file, directory or wildcard pattern that describes what to upload
29+
path: main
30+
# The desired behavior if no files are found using the provided path.
31+
Available Options:
32+
warn: Output a warning but do not fail the action
33+
error: Fail the action with an error message
34+
ignore: Do not output any warnings or errors, the action does not fail
35+
36+
if-no-files-found: # optional, default is warn
37+
# Duration after which artifact will expire in days. 0 means using default retention.
38+
Minimum 1 day. Maximum 90 days unless changed from the repository settings page.
2539

40+
retention-days: # optional
41+
42+
- name: GitHub Releases
43+
# You may pin to the exact commit or the version.
44+
# uses: fnkr/github-action-ghr@96b1448dc6162f370067e1de51e856e733a76b4f
45+
uses: fnkr/github-action-ghr@v1.3

0 commit comments

Comments
 (0)