File tree 4 files changed +75
-25
lines changed
4 files changed +75
-25
lines changed Original file line number Diff line number Diff line change 43
43
go-version : ' 1.23'
44
44
cache : true
45
45
46
- # Set up Snapcraft
47
- - name : Set up Snapcraft
48
- uses : snapcore/action-build@v1
49
- if : startsWith(github.ref, 'refs/tags/')
50
-
51
46
# Run GoReleaser
52
47
- name : Run GoReleaser
53
48
uses : goreleaser/goreleaser-action@v6
57
52
args : release --clean
58
53
env :
59
54
# Used for GitHub token and pushing to other repos
60
- GITHUB_TOKEN : ${{ secrets.GH_PERSONAL_TOKEN }}
61
- SNAPCRAFT_TOKEN : ${{ secrets.SNAPCRAFT_TOKEN }}
55
+ GITHUB_TOKEN : ${{ secrets.GH_PERSONAL_TOKEN }}
Original file line number Diff line number Diff line change
1
+ name : Build and Publish Snap
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - ' v*'
7
+
8
+ jobs :
9
+ build-and-publish :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout
13
+ uses : actions/checkout@v4
14
+ with :
15
+ fetch-depth : 0
16
+
17
+ - name : Install Snapcraft
18
+ uses : samuelmeuli/action-snapcraft@v2
19
+ with :
20
+ use_lxd : true
21
+
22
+ - name : Extract version from tag
23
+ id : get_version
24
+ run : |
25
+ VERSION=${GITHUB_REF#refs/tags/v}
26
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
27
+ echo "The version is $VERSION"
28
+
29
+ - name : Update version in snapcraft.yaml
30
+ run : |
31
+ sed -i "s/^version: git/version: $VERSION/" snap/snapcraft.yaml
32
+ cat snap/snapcraft.yaml
33
+
34
+ - name : Build snap
35
+ run : |
36
+ snapcraft
37
+
38
+ - name : Publish snap
39
+ uses : snapcore/action-publish@v1
40
+ env :
41
+ SNAPCRAFT_STORE_CREDENTIALS : ${{ secrets.SNAPCRAFT_TOKEN }}
42
+ with :
43
+ snap : httpprobe_*.snap
44
+ release : stable
Original file line number Diff line number Diff line change @@ -90,21 +90,4 @@ brews:
90
90
test : |
91
91
system "#{bin}/httpprobe", "version"
92
92
93
- # Snapcraft package
94
- snapcrafts :
95
- - name : httpprobe
96
- summary : HTTP API testing tool
97
- description : |
98
- A powerful HTTP API testing tool for defining, running,
99
- and validating API tests using YAML or JSON test definitions.
100
- grade : stable
101
- confinement : strict
102
- publish : true
103
- license : MIT
104
- base : core22
105
- apps :
106
- httpprobe :
107
- command : httpprobe
108
- plugs :
109
- - network
110
- - home
93
+ # Snapcraft is handled by external snapcraft.yaml in the snap directory
Original file line number Diff line number Diff line change
1
+ name : httpprobe
2
+ version : git
3
+ summary : HTTP API testing tool
4
+ description : |
5
+ A powerful HTTP API testing tool for defining, running,
6
+ and validating API tests using YAML or JSON test definitions.
7
+
8
+ base : core22
9
+ grade : stable
10
+ confinement : strict
11
+
12
+ parts :
13
+ httpprobe :
14
+ plugin : go
15
+ source : .
16
+ source-type : local
17
+ build-snaps :
18
+ - go
19
+ override-build : |
20
+ craftctl default
21
+ cd $CRAFT_PART_SRC
22
+ go build -o $CRAFT_PART_INSTALL/bin/httpprobe ./cmd/main.go
23
+
24
+ apps :
25
+ httpprobe :
26
+ command : bin/httpprobe
27
+ plugs :
28
+ - network
29
+ - home
You can’t perform that action at this time.
0 commit comments