Skip to content

v2.1.2

v2.1.2 #32

Workflow file for this run

name: Build and Release
on:
push:
tags:
- 'v*'
env:
APP_NAME: 'levelsync'
NIM_VERSION: '2.0.8'
jobs:
dll:
runs-on: ubuntu-latest
steps:
- name: Download DLLs
uses: wei/curl@master
with:
args: https://nim-lang.org/download/dlls.zip --output dlls.zip
- name: Unzip
uses: montudor/action-zip@v1
with:
args: unzip -qq dlls.zip
- name: Upload DLLs artifact
uses: actions/upload-artifact@v4
with:
name: dlls
path: |
cacert.pem
libcrypto-1_1.dll
libcrypto-1_1-x64.dll
sqlite3_32.dll
sqlite3_64.dll
libssl-1_1.dll
libssl-1_1-x64.dll
config:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rename config file
run: mv config.default.yaml config.yaml
- name: Upload config file artifact
uses: actions/upload-artifact@v4
with:
name: config
path: config.yaml
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nim
uses: jiro4989/setup-nim-action@v2
with:
nim-version: ${{ env.NIM_VERSION }}
- name: Build
run: nimble build -d:release --app:gui -y
- name: Upload binary artifacts
uses: actions/upload-artifact@v4
with:
name: binary-${{ matrix.os }}
path: |
${{ env.APP_NAME }}
${{ env.APP_NAME }}.exe
package-windows:
runs-on: ubuntu-latest
needs: [build, dll, config]
steps:
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: binary-windows-latest
- name: Download DLLs artifacts
uses: actions/download-artifact@v4
with:
name: dlls
- name: Download config artifact
uses: actions/download-artifact@v4
with:
name: config
- name: Zip binary + dlls + config
uses: montudor/action-zip@v1
with:
args: zip -qq -r ${{ env.APP_NAME }}-windows.zip .
- name: Upload Windows zip artifact
uses: actions/upload-artifact@v4
with:
name: package-windows-latest
path: ${{ env.APP_NAME }}-windows.zip
package-linux:
runs-on: ubuntu-latest
needs: [build, config]
steps:
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: binary-ubuntu-latest
- name: Download config artifact
uses: actions/download-artifact@v4
with:
name: config
- name: Zip binary + config
uses: montudor/action-zip@v1
with:
args: zip -qq -r ${{ env.APP_NAME }}-linux.zip .
- name: Upload Linux zip artifact
uses: actions/upload-artifact@v4
with:
name: package-linux-latest
path: ${{ env.APP_NAME }}-linux.zip
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
mytoken: ${{ secrets.GITHUB_TOKEN }}
- name: Write changelog to file
run: |
cat > changelog.txt << "EOF"
${{ steps.changelog.outputs.changelog }}
EOF
- name: Upload changelog artifact
uses: actions/upload-artifact@v4
with:
name: changelog
path: changelog.txt
release:
runs-on: ubuntu-latest
needs: [changelog, package-windows, package-linux]
steps:
- name: Download Windows package
uses: actions/download-artifact@v4
with:
name: package-windows-latest
- name: Download Linux package
uses: actions/download-artifact@v4
with:
name: package-linux-latest
- name: Download changelog
uses: actions/download-artifact@v4
with:
name: changelog
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body_path: changelog.txt
files: |
${{ env.APP_NAME }}-linux.zip
${{ env.APP_NAME }}-windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}