Skip to content

Commit 0d679bd

Browse files
committed
update release steps in CD
Signed-off-by: Daniel Stamer <[email protected]>
1 parent aa67f5b commit 0d679bd

File tree

1 file changed

+13
-83
lines changed

1 file changed

+13
-83
lines changed

.github/workflows/build-and-release.yaml

Lines changed: 13 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -25,93 +25,23 @@ jobs:
2525
GOARCH: amd64
2626
GOOS: linux
2727
CGO_ENABLED: 0
28-
- name: release
29-
run: |
30-
./node_modules/github-release-cli/bin/github-release upload --token "${GITHUB_TOKEN}" --owner helloworlddan --repo tresor --tag "linux-v${VERSION}" --name "tresor_linux64" --body "Current stable release for Linux 64-bit" tresor_linux64 tresor_linux64.sha256
28+
- name: create release
29+
id: release
30+
uses: actions/create-release@v1
3131
env:
3232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
VERSION: 1.1.1
34-
35-
release-linux-aarch64:
36-
name: release linux/aarch64
37-
runs-on: ubuntu-latest
38-
steps:
39-
- name: setup go
40-
uses: actions/setup-go@v1
4133
with:
42-
go-version: 1.13
43-
- name: checkout source
44-
uses: actions/checkout@master
45-
- name: get dependencies
46-
run: |
47-
npm install github-release-cli
48-
- name: build
49-
run: |
50-
go build -v -o tresor_linux64a main.go
51-
sha256sum tresor_linux64a > tresor_linux64a.sha256
52-
env:
53-
GOARCH: arm64
54-
GOOS: linux
55-
CGO_ENABLED: 0
56-
- name: release
57-
run: |
58-
./node_modules/github-release-cli/bin/github-release upload --token "${GITHUB_TOKEN}" --owner helloworlddan --repo tresor --tag "linux-v${VERSION}a" --name "tresor_linux64a" --body "Current stable release for Linux 64-bit ARM" tresor_linux64a tresor_linux64a.sha256
34+
tag_name: ${{ github.ref }}
35+
release_name: Release Linux x86_64 ${{ github.ref }}
36+
draft: false
37+
prerelease: false
38+
- name: upload release asset
39+
uses: actions/upload-release-asset@v1
5940
env:
6041
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
VERSION: 1.1.1
62-
63-
release-darwin-amd64:
64-
name: release darwin/amd64
65-
runs-on: ubuntu-latest
66-
steps:
67-
- name: setup go
68-
uses: actions/setup-go@v1
6942
with:
70-
go-version: 1.13
71-
- name: checkout source
72-
uses: actions/checkout@master
73-
- name: get dependencies
74-
run: |
75-
npm install github-release-cli
76-
- name: build
77-
run: |
78-
go build -v -o tresor_darwin64 main.go
79-
sha256sum tresor_darwin64 > tresor_darwin64.sha256
80-
env:
81-
GOARCH: amd64
82-
GOOS: darwin
83-
CGO_ENABLED: 0
84-
- name: release
85-
run: |
86-
./node_modules/github-release-cli/bin/github-release upload --token "${GITHUB_TOKEN}" --owner helloworlddan --repo tresor --tag "darwin-v${VERSION}" --name "tresor_darwin64" --body "Current stable release for MacOS 64-bit" tresor_darwin64 tresor_darwin64.sha256
87-
env:
88-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89-
VERSION: 1.1.1
43+
upload_url: ${{ steps.release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
44+
asset_path: ./tresor_linux64
45+
asset_name: tresor_linux64
46+
asset_content_type: application/octet-stream
9047

91-
release-windows-amd64:
92-
name: release windows/amd64
93-
runs-on: ubuntu-latest
94-
steps:
95-
- name: setup go
96-
uses: actions/setup-go@v1
97-
with:
98-
go-version: 1.13
99-
- name: checkout source
100-
uses: actions/checkout@master
101-
- name: get dependencies
102-
run: |
103-
npm install github-release-cli
104-
- name: build
105-
run: |
106-
go build -v -o tresor.exe main.go
107-
sha256sum tresor.exe > tresor.exe.sha256
108-
env:
109-
GOARCH: amd64
110-
GOOS: windows
111-
CGO_ENABLED: 0
112-
- name: release
113-
run: |
114-
./node_modules/github-release-cli/bin/github-release upload --token "${GITHUB_TOKEN}" --owner helloworlddan --repo tresor --tag "windows-v${VERSION}" --name "tresor.exe" --body "Current stable release for Windows 64-bit" tresor.exe tresor.exe.sha256
115-
env:
116-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117-
VERSION: 1.1.1

0 commit comments

Comments
 (0)