X #130
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
name: CI | |
# Events that trigger workflow | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
jobs: | |
windows: | |
name: Build (Windows) | |
runs-on: windows-2019 | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Export Repo URL | |
run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV | |
- name: Export Branch Name | |
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Clone Submodules | |
run: git submodule update --init | |
- name: Build Distribution | |
shell: pwsh | |
run: | | |
yarn | |
yarn build | |
cd .\dist | |
Compress-Archive *.exe .\nudelta-amd64.exe.zip | |
cp .\nudelta-amd64.exe.zip .. | |
- name: Upload App | |
uses: actions/upload-artifact@v3 | |
with: | |
name: win-app | |
path: ./nudelta-amd64.exe.zip | |
linux: | |
name: Build (Linux) | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Export Repo URL | |
run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV | |
- name: Export Branch Name | |
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Clone Submodules | |
run: git submodule update --init | |
- name: Build Distribution | |
run: | | |
docker build -t appimage-build . | |
id=$(docker create appimage-build) ; \ | |
docker cp $id:/nudelta.AppImage nudelta-amd64.AppImage ; \ | |
docker rm -v $id | |
- name: Upload AppImage | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-appimage | |
path: ./nudelta-amd64.AppImage | |
macos: | |
name: Build (macOS) | |
runs-on: macos-11 | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Export Repo URL | |
run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV | |
- name: Export Branch Name | |
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Clone Submodules | |
run: git submodule update --init | |
- name: Get Cmake | |
run: | | |
brew install cmake | |
- name: Build Distribution | |
run: | | |
yarn | |
yarn build | |
cp -r ./dist/*.dmg ./nudelta-universal.app.dmg | |
- name: Upload App | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mac-app | |
path: ./nudelta-universal.app.dmg | |
publish: | |
name: Publish | |
runs-on: ubuntu-20.04 | |
needs: [macos, linux, windows] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Export Repo URL | |
run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV | |
- name: Export Branch Name | |
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Set default for env.NEW_TAG | |
run: echo "NEW_TAG=NO_NEW_TAG" >> $GITHUB_ENV | |
- name: Download Linux App | |
uses: actions/download-artifact@v3 | |
with: | |
name: linux-appimage | |
path: /tmp | |
- name: Download Mac App | |
uses: actions/download-artifact@v3 | |
with: | |
name: mac-app | |
path: /tmp | |
- name: Download Windows App | |
uses: actions/download-artifact@v3 | |
with: | |
name: win-app | |
path: /tmp | |
- name: Check for new version | |
if: ${{ env.BRANCH_NAME == 'main' }} | |
run: | | |
cd ${GITHUB_WORKSPACE}/ && python3 .github/scripts/generate_tag.py | |
- name: Tag Commit | |
if: ${{ env.NEW_TAG != 'NO_NEW_TAG' }} | |
uses: tvdias/[email protected] | |
with: | |
tag: "${{ env.NEW_TAG }}" | |
repo-token: "${{ secrets.MY_TOKEN }}" | |
- name: Upload Release Asset | |
if: ${{ env.NEW_TAG != 'NO_NEW_TAG' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.NEW_TAG }} | |
body: > | |
Changelog: https://github.com/donn/nudelta/blob/main/Changelog.md | |
![Screencap](https://raw.githubusercontent.com/donn/nudelta/main/res/screencap.png) | |
A Windows `.exe`, a macOS `.app` and a Linux `.AppImage` have all been built. | |
On Windows, you will need to download and unzip the `.exe` file. | |
You may see a Windows SmartScreen warning- you can safely ignore it. | |
On macOS, you will need to download the `.dmg` file, drag it into | |
your Applications folder, then **Right-click > Open** the app on | |
macOS. The app is not code-signed or notarized, and while it is | |
universal, writing only works on x86-64 | |
(see: https://github.com/donn/nudelta/issues/37). | |
Use at your own risk. | |
On Linux, download the `.AppImage`, enable "allow executing file as | |
program" in its properties (shown below), then double-click it. | |
* You may need to install `libudev` separately- on Ubuntu, you can | |
run `sudo apt-get install -y libudev`. | |
![Setting Linux execute permission with the GNOME File Browser](https://raw.githubusercontent.com/donn/nudelta/main/res/linux_exec_permission.png) | |
files: | | |
/tmp/nudelta-universal.app.dmg | |
/tmp/nudelta-amd64.exe.zip | |
/tmp/nudelta-amd64.AppImage |