Skip to content
This repository has been archived by the owner on Sep 12, 2021. It is now read-only.

Commit

Permalink
Automate release file build and remove readme info on the matter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Dec 23, 2019
1 parent b2f33e4 commit 441fe56
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 22 deletions.
22 changes: 0 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,6 @@
Sparta, a Sport and Rehearsal Tracking Application with a focus for privacy and security.
The application uses encryption and locally stored files to keep your activities private and hidden from spying eyes.

## Cross compiling using fyne-cross
Run the following command from the root of the repo:
```bash
sudo ../../bin/fyne-cross --targets=windows/amd64,darwin/amd64,linux/amd64 --output=sparta ./src/
```

## Packaging the logo
Run the following command for bundling the icon in a windows binary:
```bash
(cd src && ../../../bin/fyne package -icon ../assets/bundled-logo.png -executable ../sparta-windows-amd64.exe -os windows -name sparta)
```

Run the following command for bundling the icon in a macos binary:
```bash
(cd src && ../../../bin/fyne package -icon ../assets/bundled-logo.png -executable ../sparta-darwin-amd64 -os darwin -name sparta)
```

Run the following command for bundling the icon in a linux binary and installer:
```bash
(cd src && ../../../bin/fyne package -icon ../assets/bundled-logo.png -executable ../sparta-linux-amd64 -os linux -name sparta)
```

## Folder structure:
- assets/ : Storage of icons used in the project.
- src/ : The place where all application code is placed and home of the simple main.go file.
Expand Down
38 changes: 38 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#! /bin/bash

# First we make sure to remove and recreate the build directory.
rm -rf build
mkdir build

# Do the initial build for the release.
sudo ~/go/bin/fyne-cross --targets=windows/amd64,darwin/amd64,linux/amd64 --output=sparta ./src/

# Make sure to set the correct access rights to the binaries.
(cd build && sudo chmod 666 sparta-linux-amd64 sparta-darwin-amd64 sparta-windows-amd64.exe)

# Prepare the windows executable to be packaged with the icon.
(cd src && ~/go/bin/fyne package -icon ../assets/bundled-logo.png -executable ../build/sparta-windows-amd64.exe -os windows -name Sparta)
cp build/fyne.syso src/fyne.syso

# Package the darwin executable as an application.
(cd src && ~/go/bin/fyne package -icon ../assets/bundled-logo.png -executable ../build/sparta-darwin-amd64 -os darwin -name Sparta)

# Build the windows binary again to incorporate the logo.
sudo ~/go/bin/fyne-cross --targets=windows/amd64 --output=sparta ./src/

# Clean up inside the src folder.
rm -rf src/usr/ src/fyne.syso
mv src/Sparta.app build/Sparta.app

# Clean up in the build folder (Sparta.app is the one to use).
rm -f build/sparta-darwin-amd64 build/fyne.syso
sudo chmod 666 build/sparta-windows-amd64.exe

# Lastly we want to compress all the binaries.
tar -cJf build/sparta-linux-amd64.tar.gz build/sparta-linux-amd64
tar -cJf build/sparta-darwin-amd64.tar.gz build/Sparta.app
(cd build && zip sparta-windows-amd64.zip sparta-windows-amd64.exe)

# Final cleanup in the build folder.
rm -rf build/Sparta.app build/sparta-linux-amd64 build/sparta-windows-amd64.exe

0 comments on commit 441fe56

Please sign in to comment.