Skip to content

Commit 649fb6e

Browse files
committed
fix fyne package to use manualy builded bin
1 parent 057a408 commit 649fb6e

File tree

4 files changed

+5
-44
lines changed

4 files changed

+5
-44
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
- name: Build binary for ${{ matrix.target }} on ${{ matrix.arch }}
5656
shell: bash
5757
run: |
58+
go clean -cache
5859
task ${{ matrix.target }}:build VERSION=${{ env.VERSION }} ARCH=${{ matrix.arch }} PRODUCTION=${{ inputs.tag_name != '' }} BIN_DIR="."
5960
- name: Package binary for ${{ matrix.target }} on ${{ matrix.arch}}
6061
# We don't need to package for windows since Fyne package generates a similar .exe as go build.

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ tasks:
109109
desc: Packages MassaStation using fyne
110110
platforms: [linux, darwin]
111111
cmds:
112-
- cmd: fyne package -src ./cmd/massastation -icon ../../int/systray/embedded/logo.png -name MassaStation --app-id net.massalabs.massastation {{if .OS}}--os {{.OS}}{{end}}
112+
- cmd: fyne package -name MassaStation -exe build/massastation/massastation -icon ./int/systray/embedded/logo.png --app-id net.massalabs.massastation {{if .OS}}--os {{.OS}}{{end}}
113113

114114
generate-dirs:
115115
desc: Generates required directories for MassaStation

installer/deb/create_deb.sh

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,6 @@ fatal() {
1717
exit 1
1818
}
1919

20-
# Install dependencies required to build the MassaStation binary.
21-
install_massastation_build_dependencies() {
22-
sudo apt-get update || fatal "failed to update apt"
23-
sudo apt-get install -y --fix-missing libgl1-mesa-dev xorg-dev || fatal "failed to install libgl1-mesa-dev xorg-dev"
24-
go install fyne.io/tools/cmd/fyne@v1.7.0 || fatal "failed to install fyne.io/tools/cmd/fyne@v1.7.0"
25-
go install github.com/go-swagger/go-swagger/cmd/swagger@latest || fatal "failed to install github.com/go-swagger/go-swagger/cmd/swagger@latest"
26-
go install golang.org/x/tools/cmd/stringer@latest || fatal "failed to install golang.org/x/tools/cmd/stringer@latest"
27-
}
28-
29-
# Build MassaStation from source.
30-
build_massastation() {
31-
install_massastation_build_dependencies
32-
33-
# Ensure go install binaries are in PATH
34-
export PATH="$PATH:$(go env GOPATH)/bin"
35-
36-
go generate ../... || fatal "go generate failed for $MASSASTATION_BINARY_NAME"
37-
export GOARCH=$ARCH
38-
export CGO_ENABLED=1
39-
fyne package -src ../cmd/massastation -icon ../../int/systray/embedded/logo.png -name MassaStation --app-id com.massalabs.massastation || fatal "fyne package failed for $MASSASTATION_BINARY_NAME"
40-
}
41-
4220
# Delete the build directory if it exists.
4321
clean() {
4422
if [ -d $BUILD_DIR ]; then
@@ -60,7 +38,7 @@ main() {
6038

6139
install_dependencies
6240

63-
test -f $MASSASTATION_ARCHIVE_NAME || build_massastation
41+
test -f $MASSASTATION_ARCHIVE_NAME || fatal "$MASSASTATION_ARCHIVE_NAME not found"
6442

6543
mkdir -p $TMP_DIR || fatal "failed to create $TMP_DIR"
6644
tar -xf $MASSASTATION_ARCHIVE_NAME -C $TMP_DIR || fatal "failed to extract $MASSASTATION_ARCHIVE_NAME to $TMP_DIR"

installer/macos/create_pkg.sh

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,6 @@ fatal() {
3535
exit 1
3636
}
3737

38-
# Install dependencies required to build the MassaStation binary.
39-
install_massastation_build_dependencies() {
40-
go install fyne.io/tools/cmd/fyne@v1.7.0
41-
go install github.com/go-swagger/go-swagger/cmd/swagger@latest
42-
go install golang.org/x/tools/cmd/stringer@latest
43-
}
44-
45-
# Build MassaStation from source.
46-
build_massastation() {
47-
install_massastation_build_dependencies
48-
49-
go generate ../... || fatal "go generate failed for $MASSASTATION_APPLICATION_NAME"
50-
export GOARCH=$ARCH
51-
export CGO_ENABLED=1
52-
fyne package -src ../cmd/massastation -icon ../../int/systray/embedded/logo.png -name MassaStation --app-id com.massalabs.massastation || fatal "fyne package failed for $MASSASTATION_APPLICATION_NAME"
53-
chmod +x $MASSASTATION_APPLICATION_NAME || fatal "failed to chmod $MASSASTATION_APPLICATION_NAME"
54-
}
55-
5638
# Build the package using pkgbuild.
5739
package() {
5840
# sign the application if we have a developer id
@@ -73,8 +55,8 @@ package() {
7355
}
7456

7557
main() {
76-
# build massastation only if the .app is not present
77-
test -d $MASSASTATION_APPLICATION_NAME || build_massastation
58+
59+
test -d $MASSASTATION_APPLICATION_NAME || fatal "$MASSASTATION_APPLICATION_NAME not found"
7860

7961
if [ ! -d macos/resources ]; then
8062
mkdir macos/resources || fatal "failed to create resources directory"

0 commit comments

Comments
 (0)