33 push :
44 tags :
55 - ' *'
6-
76jobs :
87 create-release :
98 name : Create release
2625 body_path : CHANGELOG.md
2726 - id : step_upload_url
2827 run : echo "::set-output name=upload_url::${{ steps.create_release.outputs.upload_url }}"
29-
28+
3029 build-and-publish :
3130 name : Publish release
3231 needs : create-release
@@ -40,55 +39,44 @@ jobs:
4039 - name : Install go
4140 uses : actions/setup-go@v2
4241 with :
43- go-version : ' 1.13'
44- - name : Install dependencies for linux build
45- if : ${{ matrix.os == 'ubuntu-latest' }}
46- run : |
47- sudo apt update && sudo apt install -y build-essential zip
48- - name : Install dependencies for windows build
49- if : ${{ matrix.os == 'ubuntu-18.04' }}
42+ go-version : ' 1.16'
43+
44+ - name : Install dependencies for macOS build
45+ if : ${{ matrix.os == 'macos-latest' }}
5046 run : |
51- sudo apt update && sudo apt install -y gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 wine64
52- - name : Install go dependencies
47+ go mod download
48+ - name : Build and package artifacts for macOS build
49+ if : ${{ matrix.os == 'macos-latest' }}
5350 run : |
54- go get github.com/sirupsen/logrus
55- go get github.com/ipfs/go-ipfs-api
56- go get github.com/mjibson/esc
57-
58- - name : Build libipfs for linux
59- if : ${{ matrix.os == 'ubuntu-latest' }}
60- run : make build_linux
61-
62- - name : Build libipfs for windows
63- if : ${{ matrix.os == 'ubuntu-18.04' }}
64- run : make build_windows
65-
66- - name : Build libipfs for macOS
51+ make build_macos_x64
52+ mkdir libipfs${{ github.event.release.tag_name }}-macOS-x64/
53+ cp -rf ./bin/libipfs-mac* libipfs${{ github.event.release.tag_name }}-macOS-x64/
54+ zip -r libipfs${{ github.event.release.tag_name }}-macOS-x64.zip libipfs${{ github.event.release.tag_name }}-macOS-x64/
55+ - name : Upload macOS build artifacts
6756 if : ${{ matrix.os == 'macos-latest' }}
68- run : make build_macos
57+ uses : actions/upload-release-asset@v1
58+ env :
59+ GITHUB_TOKEN : ${{ github.token }}
60+ with :
61+ upload_url : ${{ needs.create-release.outputs.upload_url }}
62+ asset_path : ./libipfs${{ github.event.release.tag_name }}-macOS-x64.zip
63+ asset_name : libipfs${{ github.event.release.tag_name }}-macOS-x64.zip
64+ asset_content_type : application/zip
6965
70- - name : Pacakge artifacts linux
66+ - name : Install dependencies for linux build
67+ if : ${{ matrix.os == 'ubuntu-latest' }}
68+ run : |
69+ sudo apt update && sudo apt install -y build-essential zip
70+ go mod download
71+
72+ - name : Build and package artifacts for linux build
7173 if : ${{ matrix.os == 'ubuntu-latest' }}
7274 run : |
75+ make build_linux
7376 mkdir libipfs${{ github.event.release.tag_name }}-linux-x64/
7477 cp -rf ./bin/libipfs-linux* libipfs${{ github.event.release.tag_name }}-linux-x64/
7578 zip -r libipfs${{ github.event.release.tag_name }}-linux-x64.zip libipfs${{ github.event.release.tag_name }}-linux-x64/
76-
77- - name : Pacakge artifacts windows
78- if : ${{ matrix.os == 'ubuntu-18.04' }}
79- run : |
80- mkdir libipfs${{ github.event.release.tag_name }}-win-x64/
81- cp -rf ./bin/libipfs-win* libipfs${{ github.event.release.tag_name }}-win-x64/
82- zip -r libipfs${{ github.event.release.tag_name }}-win-x64.zip libipfs${{ github.event.release.tag_name }}-win-x64/
83-
84- - name : Pacakge artifacts macOS
85- if : ${{ matrix.os == 'macos-latest' }}
86- run : |
87- mkdir libipfs${{ github.event.release.tag_name }}-macOS-x64/
88- cp -rf ./bin/libipfs-mac* libipfs${{ github.event.release.tag_name }}-macOS-x64/
89- zip -r libipfs${{ github.event.release.tag_name }}-macOS-x64.zip libipfs${{ github.event.release.tag_name }}-macOS-x64/
90-
91- - name : Upload aritifacts for linux
79+ - name : Upload linux build artifacts
9280 if : ${{ matrix.os == 'ubuntu-latest' }}
9381 uses : actions/upload-release-asset@v1
9482 env :
9987 asset_name : libipfs${{ github.event.release.tag_name }}-linux-x64.zip
10088 asset_content_type : application/zip
10189
102- - name : Upload aritifacts for windows
90+ - name : Install dependencies for windows build
91+ if : ${{ matrix.os == 'ubuntu-18.04' }}
92+ run : |
93+ sudo apt update && sudo apt install -y gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 wine64
94+ go mod download
95+
96+ - name : Build and package artifacts for windows build
97+ if : ${{ matrix.os == 'ubuntu-18.04' }}
98+ run : |
99+ make build_windows
100+ mkdir libipfs${{ github.event.release.tag_name }}-win-x64/
101+ cp -rf ./bin/libipfs-win* libipfs${{ github.event.release.tag_name }}-win-x64/
102+ zip -r libipfs${{ github.event.release.tag_name }}-win-x64.zip libipfs${{ github.event.release.tag_name }}-win-x64/
103+
104+ - name : Upload windows build artifacts
103105 if : ${{ matrix.os == 'ubuntu-18.04' }}
104106 uses : actions/upload-release-asset@v1
105107 env :
@@ -108,15 +110,4 @@ jobs:
108110 upload_url : ${{ needs.create-release.outputs.upload_url }}
109111 asset_path : ./libipfs${{ github.event.release.tag_name }}-win-x64.zip
110112 asset_name : libipfs${{ github.event.release.tag_name }}-win-x64.zip
111- asset_content_type : application/zip
112-
113- - name : Upload aritifacts for macOS
114- if : ${{ matrix.os == 'macos-latest' }}
115- uses : actions/upload-release-asset@v1
116- env :
117- GITHUB_TOKEN : ${{ github.token }}
118- with :
119- upload_url : ${{ needs.create-release.outputs.upload_url }}
120- asset_path : ./libipfs${{ github.event.release.tag_name }}-macOS-x64.zip
121- asset_name : libipfs${{ github.event.release.tag_name }}-macOS-x64.zip
122- asset_content_type : application/zip
113+ asset_content_type : application/zip
0 commit comments