Skip to content

Commit 7167d38

Browse files
authored
Merge pull request #12 from Notifiarr/unstable
Add more relase steps
2 parents 9cb0276 + 1681a24 commit 7167d38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1778
-247
lines changed

.github/workflows/codetests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ jobs:
2828

2929

3030
golangci:
31-
# description: "Runs golangci-lint on macos against freebsd and macos."
3231
strategy:
3332
matrix:
34-
os: [freebsd, darwin, linux, windows]
33+
os: [darwin, linux, windows]
3534
name: golangci-lint
3635
runs-on: macos-latest
3736
env:

.github/workflows/release.yml

Lines changed: 82 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ jobs:
1010
package:
1111
strategy:
1212
matrix:
13-
platform: [ubuntu-latest]
13+
platform: [macos-latest, ubuntu-latest]
1414
runs-on: ${{ matrix.platform }}
15+
outputs:
16+
version: ${{ steps.version.outputs.version }}
17+
revision: ${{ steps.version.outputs.revision }}
1518
steps:
1619
- uses: actions/checkout@v3
1720
with:
@@ -29,6 +32,7 @@ jobs:
2932
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
3033

3134
- name: Inject Version Info
35+
id: version
3236
run: |
3337
VERSION=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1) | tr -d v)
3438
[ "$VERSION" != "" ] || VERSION=0.0.0
@@ -44,6 +48,8 @@ jobs:
4448
echo "VERSION_LDFLAGS=${VERSION_LDFLAGS}" >> $GITHUB_ENV
4549
echo "VERSION=${VERSION}" >> $GITHUB_ENV
4650
echo "REVISION=${REVISION}" >> $GITHUB_ENV
51+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
52+
echo "revision=${REVISION}" >> $GITHUB_OUTPUT
4753
4854
- name: Build macOS
4955
if: runner.os == 'macOS' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable')
@@ -68,8 +74,7 @@ jobs:
6874
6975
# This one sucked to figure out, and it's slow, but it works!
7076
- name: Build Linux ARM
71-
if: runner.os == 'Linux'
72-
# && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable')
77+
if: runner.os == 'Linux' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable')
7378
uses: pguyot/arm-runner-action@v2
7479
with:
7580
base_image: https://cdimage.ubuntu.com/releases/22.10/release/ubuntu-22.10-preinstalled-desktop-arm64+raspi.img.xz
@@ -86,19 +91,17 @@ jobs:
8691
go build -o build/bin/toolbarr.arm64 -ldflags='${{ env.VERSION_LDFLAGS }}' .
8792
8893
- name: Build Windows
89-
if: runner.os == 'Windows'
94+
if: runner.os == 'Linux'
9095
env:
9196
EXE_SIGNING_KEY: ${{ secrets.EXE_SIGNING_KEY }}
9297
EXE_SIGNING_KEY_PASSWORD: ${{ secrets.EXE_SIGNING_KEY_PASSWORD }}
9398
run: |
9499
wails build -s -m -trimpath -platform windows/amd64 -nsis -webview2 embed -o Toolbarr.amd64.exe -ldflags='${{ env.VERSION_LDFLAGS }}'
95100
wails build -s -m -trimpath -platform windows/arm64 -nsis -webview2 embed -o Toolbarr.arm64.exe -ldflags='${{ env.VERSION_LDFLAGS }}'
96-
build/windows/signexe.sh
97-
for FILE in build/bin/*.exe; do zip -9D "${FILE%.*}.zip" "${FILE}"; done
101+
for FILE in build/bin/*.a??64.exe; do zip -9j "${FILE%.*}.zip" "${FILE}"; done
98102
99103
- name: Package Linux Binaries
100-
if: runner.os == 'Linux'
101-
# && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable')
104+
if: runner.os == 'Linux' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable')
102105
env:
103106
KEYID: B93DD66EF98E54E2EAE025BA0166AD34ABC5A57C
104107
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
@@ -137,14 +140,32 @@ jobs:
137140
name: toolbarr-${{ matrix.platform }}
138141
path: build/bin/*
139142

143+
deploy-unstable-packagecloud:
144+
# description: "Uploads pre-built RPM and DEB packages to packagecloud.io/golift"
145+
if: github.ref == 'refs/heads/unstable'
146+
needs: package
147+
name: Deploy Unstable PackageCloud
148+
runs-on: ubuntu-latest
149+
steps:
150+
- name: Download release files
151+
uses: actions/download-artifact@v3
152+
with:
153+
name: toolbarr-ubuntu-latest
154+
- uses: golift/upload-packagecloud@v1
155+
with:
156+
userrepo: golift/unstable
157+
apitoken: ${{ secrets.PACKAGECLOUD_TOKEN }}
158+
packages: .
159+
rpmdists: el/6
160+
debdists: ubuntu/focal
161+
140162
deploy-unstable-unstable:
141163
# description: "Uploads pre-built binaries to unstable.golift.io."
142164
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable'
143165
strategy:
144166
matrix:
145167
files: [toolbarr-macos-latest, toolbarr-ubuntu-latest]
146-
needs:
147-
- package
168+
needs: package
148169
name: Deploy Unstable
149170
runs-on: ubuntu-latest
150171
steps:
@@ -154,8 +175,57 @@ jobs:
154175
name: ${{ matrix.files }}
155176
- name: Upload files to unstable.golift.io
156177
run: >-
157-
for file in *.{zip,dmg,gz}; do
178+
for file in *.{zip,dmg,gz,installer.exe}; do
158179
[ -f "$file" ] || continue;
159180
echo "Uploading: ${file}";
160181
curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=toolbarr" -F "file=@${file}";
161-
done
182+
echo '{"version":"${{needs.package.outputs.version}}","revision":${{needs.package.outputs.revision}},"size":'$(stat --printf="%s" ${file})'}' >> ${file}.txt
183+
curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=toolbarr" -F "file=@${file}.txt";
184+
done
185+
186+
deploy-release-packagecloud:
187+
# description: "Uploads pre-built RPM and DEB packages to packagecloud.io/golift"
188+
if: startsWith(github.ref, 'refs/tags/v')
189+
needs: package
190+
name: Deploy Release PackageCloud
191+
runs-on: ubuntu-latest
192+
steps:
193+
- name: Download release files
194+
uses: actions/download-artifact@v3
195+
with:
196+
name: toolbarr-ubuntu-latest
197+
- uses: golift/upload-packagecloud@v1
198+
with:
199+
userrepo: golift/pkgs
200+
apitoken: ${{ secrets.PACKAGECLOUD_TOKEN }}
201+
packages: .
202+
rpmdists: el/6
203+
debdists: ubuntu/focal
204+
205+
deploy-github-release:
206+
# description: uploads all the built release assets to the GitHub Release.
207+
if: startsWith(github.ref, 'refs/tags/v')
208+
permissions:
209+
contents: write
210+
needs: package
211+
strategy:
212+
matrix:
213+
files: [toolbarr-macos-latest, toolbarr-ubuntu-latest]
214+
name: Deploy GitHub Release
215+
runs-on: ubuntu-latest
216+
steps:
217+
- name: Download ${{ matrix.files }} Files
218+
uses: actions/download-artifact@v3
219+
with:
220+
name: ${{ matrix.files }}
221+
- name: Publish ${{ matrix.files }} artifacts to github
222+
uses: softprops/action-gh-release@v1
223+
with:
224+
files: |
225+
*.rpm
226+
*.deb
227+
*.zip
228+
*.dmg
229+
*.gz
230+
*.txt
231+
*.installer.exe

build/windows/installer/project.nsi

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,45 @@ VIAddVersionKey "ProductName" "${INFO_PRODUCTNAME}"
4949

5050
!define MUI_ICON "..\icon.ico"
5151
!define MUI_UNICON "..\icon.ico"
52-
# !define MUI_WELCOMEFINISHPAGE_BITMAP "resources\dynamite.bmp" #Include this to add a bitmap on the left side of the Welcome Page. Must be a size of 164x314
52+
!define MUI_WELCOMEFINISHPAGE_BITMAP "resources\side.bmp" #Include this to add a bitmap on the left side of the Welcome Page. Must be a size of 164x314
5353
!define MUI_FINISHPAGE_NOAUTOCLOSE # Wait on the INSTFILES page so the user can take a look into the details of the installation steps
5454
!define MUI_ABORTWARNING # This will warn the user if they exit from the installer.
55+
!define MUI_FINISHPAGE_RUN "$INSTDIR\\${PRODUCT_EXECUTABLE}"
56+
!define MUI_FINISHPAGE_SHOWREADME "" # This reuses the 'show readme' checkbox to make a shortcut.
57+
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
58+
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut"
59+
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION createDesktopShortcut
60+
!define REGKEY "SOFTWARE\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}"
61+
!define INSTALL_LOCATION "$PROGRAMFILES64\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}"
5562

5663
!insertmacro MUI_PAGE_WELCOME # Welcome to the installer page.
5764
!insertmacro MUI_PAGE_LICENSE "resources\eula.txt" # Adds a EULA page to the installer
5865
!insertmacro MUI_PAGE_DIRECTORY # In which folder install page.
5966
!insertmacro MUI_PAGE_INSTFILES # Installing page.
6067
!insertmacro MUI_PAGE_FINISH # Finished installation page.
61-
6268
!insertmacro MUI_UNPAGE_INSTFILES # Uinstalling page
63-
6469
!insertmacro MUI_LANGUAGE "English" # Set the Language of the installer
6570

6671
## The following two statements can be used to sign the installer and the uninstaller. The path to the binaries are provided in %1
6772
!uninstfinalize '../signexe.sh "%1"'
6873
!finalize '../signexe.sh "%1"'
6974

7075
Name "${INFO_PRODUCTNAME}"
71-
OutFile "..\..\bin\${INFO_PROJECTNAME}-${ARCH}-installer.exe" # Name of the installer's file.
72-
InstallDir "$PROGRAMFILES64\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}" # Default installing folder ($PROGRAMFILES is Program Files folder).
76+
OutFile "..\..\bin\${INFO_PROJECTNAME}.${ARCH}.installer.exe" # Name of the installer's file.
77+
InstallDir "${INSTDIR}" # Default installing folder ($PROGRAMFILES is Program Files folder).
7378
ShowInstDetails show # This will always show the installation details.
79+
InstallDirRegKey HKLM "$REGKEY" InstallLocation
80+
81+
Function createDesktopShortcut
82+
CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
83+
FunctionEnd
7484

7585
Function .onInit
76-
!insertmacro wails.checkArchitecture
86+
!insertmacro wails.checkArchitecture
87+
SetRegView 64
88+
ReadRegStr $INSTDIR HKLM "${REGKEY}" InstallLocation
89+
StrCmp $INSTDIR "" 0 +2
90+
StrCpy $INSTDIR "${INSTALL_LOCATION}"
7791
FunctionEnd
7892

7993
Section
@@ -84,18 +98,22 @@ Section
8498
!insertmacro wails.files
8599

86100
CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
87-
CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
101+
SetRegView 64
102+
WriteRegStr HKLM "${REGKEY}" InstallLocation "$INSTDIR"
88103

89104
!insertmacro wails.writeUninstaller
90105
SectionEnd
91106

92107
Section "uninstall"
93108
RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath
94-
109+
SetRegView 64
110+
ReadRegStr $INSTDIR HKLM "${REGKEY}" InstallLocation
111+
StrCmp $INSTDIR "" +2 0
95112
RMDir /r $INSTDIR
96-
97113
Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk"
98114
Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk"
115+
SetRegView 64
116+
DeleteRegKey HKLM "${REGKEY}"
99117

100118
!insertmacro wails.deleteUninstaller
101119
SectionEnd

build/windows/installer/resources/eula.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ NOTIFIARR END USER LICENSE AGREEMENT
22

33
Your use of this software constitutes unbinding agreement with this license.
44

5-
You shall forever acknowledge the creators of this application as supreme overlords.
5+
You shall forever acknowledge the creators of this application as supreme overlords.
6+
7+
- Team Notifiarr
151 KB
Binary file not shown.
1.08 MB
Binary file not shown.

build/windows/signexe.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ function sign() {
1111
exit
1212
fi
1313

14-
# echo "${EXE_SIGNING_KEY}" | base64 -d | \
15-
# osslsigncode sign -pkcs12 /dev/stdin \
16-
# -pass "${EXE_SIGNING_KEY_PASSWORD}" \
17-
# -n "Toolbarr" \
18-
# -i "https://www.golift.io" \
19-
# -t "http://timestamp.comodoca.com/authenticode" \
20-
# -in "${FILE}" -out "signed.${FILE}"
21-
# mv "signed.${FILE}" "${FILE}"
22-
echo "Signed ${FILE} .."
14+
echo "${EXE_SIGNING_KEY}" | base64 -d | \
15+
osslsigncode sign -pkcs12 /dev/stdin \
16+
-pass "${EXE_SIGNING_KEY_PASSWORD}" \
17+
-n "Toolbarr" \
18+
-i "https://www.golift.io" \
19+
-t "http://timestamp.comodoca.com/authenticode" \
20+
-in "${FILE}" -out "signed.${FILE}"
21+
22+
mv "signed.${FILE}" "${FILE}"
23+
echo "Signed ${FILE} .."
2324
}
2425

2526
[ -z "$1" ] || FILE=$1 sign

0 commit comments

Comments
 (0)