Skip to content

Commit

Permalink
somewhat automate release process
Browse files Browse the repository at this point in the history
  • Loading branch information
omriharel committed May 11, 2020
1 parent 8485a73 commit 6d19837
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ venv/
*.exe
deej-dev
deej-release
releases/
3 changes: 2 additions & 1 deletion scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This document lists the various scripts in the project and their purposes.

> Note: All scripts are meant to be run from the root of the repository, i.e. from the `deej` directory: `scripts\whatever.bat`. They're not guaranteed to work correctly if run from another directory.
> Note: All scripts are meant to be run from the root of the repository, i.e. from the `deej` directory: `scripts\...\whatever.bat`. They're not guaranteed to work correctly if run from another directory.
### Windows

Expand All @@ -11,6 +11,7 @@ This document lists the various scripts in the project and their purposes.
- [`build-all.bat`](./windows/build-all.bat): Helper script to build all variants
- [`make-icon.bat`](./windows/make-icon.bat): Converts a .ico file to an icon byte array in a Go file. Used by our systray library. You shouldn't need to run this unless you change the deej logo
- [`make-rsrc.bat`](./windows/make-rsrc.bat): Generates a `rsrc.syso` resource file inside `cmd` alongside `main.go` - This indicates to the Go linker to use the deej application manifest and icon when building.
- [`prepare-release.bat`](./windows/prepare-release.bat): Tags, builds and renames the release binaries in preparation for a GitHub release. Usage: `prepare-release.bat vX.Y.Z` (binaries will be under `releases\vX.Y.Z\`)

### Linux

Expand Down
22 changes: 22 additions & 0 deletions scripts/misc/default-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# process names are case-insensitive
# you can use 'master' to indicate the master channel, or a list of process names to create a group
# you can also use 'system' on windows to control the "system sounds" volume
slider_mapping:
0: master
1: chrome.exe
2: spotify.exe
3:
- pathofexile_x64.exe
- rocketleague.exe
4: discord.exe

# set this to true if you want the controls inverted (i.e. top is 0%, bottom is 100%)
invert_sliders: false

# settings for connecting to the arduino board
com_port: COM4
baud_rate: 9600

# limits how often deej will look for new processes
# it's recommended to leave this setting at its default value
process_refresh_frequency: 5
20 changes: 20 additions & 0 deletions scripts/misc/release-notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
This release ___________:

- One awesome thing that happened
- Another awesome thing

Launch instructions:

- Download both `config.yaml` and `deej.exe` and place them in the same directory
- Verify that your config has the correct COM port for your Arduino board
- Launch `deej.exe`. You can always edit the config while `deej` is running

**_Linux users:_** for the time being, please build from source. If there's demand for precompiled release binaries, please [let us know!](https://discord.gg/nf88NJu)

> _Tip: If `deej.exe` seems to crash or doesn't start, please [send us](https://discord.gg/nf88NJu) the `logs\deej-latest-run.log` file from your `deej` directory.

> _Tip:_ `deej-debug.exe` is a version with a console window that displays additional logs. If you have trouble getting things to work, [join our Discord](https://discord.gg/nf88NJu) and post a snippet there.

More detailed instructions and documentation are in the [repo's main page](https://github.com/omriharel/deej).

Enjoy!
46 changes: 46 additions & 0 deletions scripts/windows/prepare-release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@ECHO OFF

IF "%1"=="" GOTO NOTAG

ECHO Preparing release (%1)...
ECHO.

git tag --delete %1 >NUL 2>&1
git tag %1

REM set windows scripts dir root in relation to script path to avoid cwd dependency
SET "WIN_SCRIPTS_ROOT=%~dp0"

CALL "%WIN_SCRIPTS_ROOT%build-dev.bat"

ECHO.

CALL "%WIN_SCRIPTS_ROOT%build-release.bat"

REM make this next part nicer by setting the repo root
SET "DEEJ_ROOT=%WIN_SCRIPTS_ROOT%..\.."
PUSHD "%DEEJ_ROOT%"
SET "DEEJ_ROOT=%CD%"
POPD

MKDIR "%DEEJ_ROOT%\releases\%1" 2> NUL
MOVE /Y "%DEEJ_ROOT%\deej-release.exe" "%DEEJ_ROOT%\releases\%1\deej.exe" >NUL 2>&1
MOVE /Y "%DEEJ_ROOT%\deej-dev.exe" "%DEEJ_ROOT%\releases\%1\deej-debug.exe" >NUL 2>&1
COPY /Y "%DEEJ_ROOT%\scripts\misc\default-config.yaml" "%DEEJ_ROOT%\releases\%1\config.yaml" >NUL 2>&1
COPY /Y "%DEEJ_ROOT%\scripts\misc\release-notes.txt" "%DEEJ_ROOT%\releases\%1\notes.txt" >NUL 2>&1

ECHO.
ECHO Release binaries created in %DEEJ_ROOT%\releases\%1
ECHO Opening release directory and notes for editing.
ECHO When you're done, run "git push origin %1" and draft the release on GitHub.

START explorer.exe "%DEEJ_ROOT%\releases\%1"
START notepad.exe "%DEEJ_ROOT%\releases\%1\notes.txt"

GOTO DONE

:NOTAG
ECHO usage: %0 ^<tag name^> (use semver i.e. v0.9.3)
GOTO DONE

:DONE

0 comments on commit 6d19837

Please sign in to comment.