-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a GitHub Actions worfklow to do releases for us
No signing at this moment but from the 81 commits I did in the other branch (mostly over this lovely quarantined weekend) you can tell I'm probably fed up with this. Cleanup and macOS signing/notarization hopefully coming at some point in the future. No Windows signing on the horizon though, because I don't really want/need a Windows code signing certificate. There's a PR by @probonopd to create a Travis workflow for AppImages, I'd like to add that here too. And finally, there should be a release script that just modifies our repo on flathub and does the releases for us.
- Loading branch information
1 parent
8c10fa8
commit 9f796e6
Showing
9 changed files
with
591 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
name: Automatic build | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
release: | ||
types: [ created ] | ||
|
||
jobs: | ||
Linux: | ||
if: github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 qt5-default libqt5gui5 libqt5webengine5 libqt5webenginecore5 libqt5webenginewidgets5 libqt5printsupport5 libqt5quickwidgets5 qml-module-qtquick-controls libqt5x11extras5 binutils cmake pkg-config qtbase5-dev qtwebengine5-dev libqt5x11extras5-dev qtbase5-private-dev libssl-dev libxss-dev libxmu-dev | ||
- name: Configure | ||
run: qmake . | ||
- name: Build | ||
run: make -j2 | ||
|
||
Flatpak: | ||
if: github.event_name == 'release' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install flatpak flatpak-builder | ||
- name: Install Flatpak KDE SDK | ||
run: | | ||
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo | ||
sudo flatpak install --system -y flathub org.kde.Platform//5.14 | ||
sudo flatpak install --system -y flathub org.kde.Sdk//5.14 | ||
- name: Build the Flatpak package | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
pushd dist/flatpak | ||
sudo flatpak-builder --repo=flatpak-repo --force-clean flatpak-build org.fedoraproject.MediaWriter.json | ||
flatpak build-bundle flatpak-repo org.fedoraproject.MediaWriter.flatpak org.fedoraproject.MediaWriter | ||
mv org.fedoraproject.MediaWriter.flatpak ../../org.fedoraproject.MediaWriter-$TAG_NAME.flatpak | ||
popd | ||
- name: Upload to GitHub | ||
if: github.event_name == 'release' | ||
shell: bash | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
bash ./dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="org.fedoraproject.MediaWriter-$TAG_NAME.flatpak" | ||
macOS: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- name: Install dependencies | ||
run: | | ||
brew install qt | ||
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile | ||
brew install xz | ||
brew install git | ||
npm install -g create-dmg | ||
- name: Configure | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
bash dist/mac/build.sh configure | ||
- name: Build | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
bash dist/mac/build.sh build | ||
- name: Insert dependencies | ||
if: github.event_name == 'release' | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
bash dist/mac/build.sh deps | ||
- name: Sign (TBD) | ||
if: github.event_name == 'release' | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
true # bash dist/mac/build.sh sign | ||
- name: Package | ||
if: github.event_name == 'release' | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
cd build/app | ||
create-dmg "Fedora Media Writer.app" || true # without signing, create-dmg returns an error code | ||
mv Fedora*.dmg ../../FedoraMediaWriter-osx-$TAG_NAME.unnotarized.dmg | ||
- name: Notarize (TBD) | ||
if: github.event_name == 'release' | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
true # bash dist/mac/build.sh notarize | ||
- name: Upload to GitHub | ||
if: github.event_name == 'release' | ||
shell: bash | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
bash ./dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="FedoraMediaWriter-osx-$TAG_NAME.unnotarized.dmg" | ||
Windows: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- name: Cache Qt | ||
id: cache-qt | ||
uses: actions/cache@v1 | ||
with: | ||
path: d:/a/MediaWriter/Qt | ||
key: QtCache | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
choco install nsis | ||
choco install dos2unix | ||
- name: Install Qt | ||
uses: jurplel/install-qt-action@v2 | ||
with: | ||
cached: ${{ steps.cache-qt.outputs.cache-hit }} | ||
arch: win64_mingw73 | ||
- name: Build xz-utils | ||
shell: bash | ||
if: ${{ !steps.cache-qt.outputs.cache-hit }} | ||
run: | | ||
git clone https://git.tukaani.org/xz.git | ||
sed -i 's/#include "config.h"//' xz/src/common/common_w32res.rc | ||
sed -i 's/PACKAGE_NAME/"liblzma"/' xz/src/common/common_w32res.rc | ||
sed -i 's/PACKAGE_URL/"https:\/\/tukaani.org\/xz\/"/' xz/src/common/common_w32res.rc | ||
mkdir xz/build | ||
cd xz/build | ||
cmake -DCMAKE_SH="CMAKE_SH-NOTFOUND" -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX="$Qt5_Dir" -DBUILD_SHARED_LIBS=ON .. | ||
mingw32-make -j2 VERBOSE=1 | ||
mingw32-make install | ||
# ugh | ||
cp "$Qt5_Dir/bin/liblzma.dll" "$Qt5_Dir/bin/libliblzma.dll" | ||
- name: Build MediaWriter | ||
shell: bash | ||
run: | | ||
#export PATH=$(echo "$PATH" | sed -e 's/:\/c\/ProgramData\/Chocolatey\/bin//' | sed -e 's/:\/c\/Strawberry\/c\/bin//') | ||
#export PATH="$Qt5_Dir/../../Tools/mingw730_32/bin:$PATH" | ||
mkdir build | ||
cd build | ||
"$Qt5_Dir/bin/qmake" .. | ||
mingw32-make -j2 VERBOSE=1 | ||
- name: Windeployqt | ||
if: github.event_name == 'release' | ||
shell: bash | ||
run: | | ||
cd build/app/release | ||
mv ../helper.exe . | ||
$Qt5_Dir/bin/windeployqt -qmldir ../../.. mediawriter.exe | ||
cp $Qt5_Dir/bin/libstdc*.dll . | ||
cp $Qt5_Dir/bin/libwinpthread*.dll . | ||
cp $Qt5_Dir/bin/libgcc*.dll . | ||
cp /c/Program\ Files/OpenSSL/bin/*.dll . | ||
- name: Installer | ||
if: github.event_name == 'release' | ||
shell: bash | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
VERSION_STRIPPED=$(sed "s/-.*//" <<< "${TAG_NAME}") | ||
if [[ "$VERSION_STRIPPED" == "" ]]; then | ||
VERSION_STRIPPED=0.0.0 | ||
fi | ||
VERSION_MAJOR=$(cut -d. -f1 <<< "${VERSION_STRIPPED}") | ||
VERSION_MINOR=$(cut -d. -f2 <<< "${VERSION_STRIPPED}") | ||
VERSION_BUILD=$(cut -d. -f3 <<< "${VERSION_STRIPPED}") | ||
INSTALLED_SIZE=$(du -k -d0 "build/app/release" | cut -f1) | ||
cp "dist/win/mediawriter_native.nsi" "dist/win/mediawriter_native.tmp.nsi" | ||
sed -i "s/#!define VERSIONMAJOR/!define VERSIONMAJOR ${VERSION_MAJOR}/" "dist/win/mediawriter_native.tmp.nsi" | ||
sed -i "s/#!define VERSIONMINOR/!define VERSIONMINOR ${VERSION_MINOR}/" "dist/win/mediawriter_native.tmp.nsi" | ||
sed -i "s/#!define VERSIONBUILD/!define VERSIONBUILD ${VERSION_BUILD}/" "dist/win/mediawriter_native.tmp.nsi" | ||
sed -i "s/#!define INSTALLSIZE/!define INSTALLSIZE ${INSTALLED_SIZE}/" "dist/win/mediawriter_native.tmp.nsi" | ||
unix2dos < "LICENSE" > "build/app/release/LICENSE.txt" | ||
makensis -DCERTPATH="" -DCERTPASS="" dist/win/mediawriter_native.tmp.nsi | ||
mv dist/win/FMW-setup.exe ./"FedoraMediaWriter-win64-$TAG_NAME.exe" | ||
- name: Upload to GitHub | ||
if: github.event_name == 'release' | ||
shell: bash | ||
run: | | ||
TAG_NAME=$(bash ./dist/get-tag-name.sh) | ||
bash ./dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="FedoraMediaWriter-win64-$TAG_NAME.exe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
PROBABLY_TAG=${GITHUB_REF/refs\/tags\//} | ||
|
||
grep "^[0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*$" <<< "$PROBABLY_TAG" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.