Skip to content

Add link to the repo #46

Add link to the repo

Add link to the repo #46

Workflow file for this run

name: Build project
on:
workflow_dispatch:
push:
tags:
- v*
jobs:
package_macos:
name: Package (macos-latest)
uses: ./.github/workflows/build-package.yaml
with:
os: macos-latest
package_windows:
name: Package (windows-latest)
uses: ./.github/workflows/build-package.yaml
with:
os: windows-latest
package_linux:
name: Package (ubuntu-latest)
uses: ./.github/workflows/build-package.yaml
with:
os: ubuntu-latest
build_rpm:
name: Build RPM
needs:
- package_linux
runs-on: ubuntu-latest
steps:
- name: Extract Version Name
id: extract_name
uses: actions/github-script@v7
with:
result-encoding: string
script: |
if (context.payload.ref.startsWith('refs/tags/')) {
return context.payload.ref.replace(/refs\/tags\/v/, '');
}
return 'dev';
- name: Checkout code
uses: actions/checkout@v4
- name: Install rpm
run: sudo apt-get -y install rpm
- name: Download built
uses: actions/download-artifact@v4
with:
name: ubuntu-latest
- name: Create sources directory
run: mkdir -p rpm/SOURCES
- name: Move file
run: mv LargeCsvReader.tar.xz rpm/SOURCES
- name: Build RPM
run: rpmbuild -ba --define "_topdir $(pwd)/rpm" --define "app_version ${{ steps.extract_name.outputs.result }}" rpm/LargeCsvReader.spec
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: rpm/RPMS/x86_64/LargeCsvReader-${{ steps.extract_name.outputs.result }}-1.x86_64.rpm
name: rpm
build_deb:
name: Build DEB
needs:
- package_linux
runs-on: ubuntu-latest
steps:
- name: Extract Version Name
id: extract_name
uses: actions/github-script@v7
with:
result-encoding: string
script: |
if (context.payload.ref.startsWith('refs/tags/')) {
return context.payload.ref.replace(/refs\/tags\/v/, '');
}
return '0.dev';
- name: Checkout code
uses: actions/checkout@v4
- name: Download built
uses: actions/download-artifact@v4
with:
name: ubuntu-latest
- name: Build deb package
env:
VERSION: ${{ steps.extract_name.outputs.result }}
run: |
mkdir -p deb/LargeCsvReader-$VERSION/DEBIAN
mkdir deb/source
tar xf LargeCsvReader.tar.xz -C deb/source
cd deb/source
PREFIX=$(pwd)/../LargeCsvReader-$VERSION make install
cd ..
cp control LargeCsvReader-$VERSION/DEBIAN
sed -i "s/{{VERSION}}/$VERSION/" LargeCsvReader-$VERSION/DEBIAN/control
dpkg-deb --build LargeCsvReader-$VERSION LargeCsvReader_${VERSION}_amd64.deb
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: deb/LargeCsvReader_${{ steps.extract_name.outputs.result }}_amd64.deb
name: deb
build_win_installer:
name: Build Windows installer
needs:
- package_windows
runs-on: windows-latest
steps:
- name: Extract Version Name
id: extract_name
uses: actions/github-script@v7
with:
result-encoding: string
script: |
if (context.payload.ref.startsWith('refs/tags/')) {
return context.payload.ref.replace(/refs\/tags\/v/, '');
}
return 'dev';
- name: Checkout Code
uses: actions/checkout@v4
- name: Download built
uses: actions/download-artifact@v4
with:
name: windows-latest
- name: Set version
env:
VERSION: ${{ steps.extract_name.outputs.result }}
run: echo %VERSION% > assets\appversion
- name: Move file
run: mv LargeCsvReader.exe windows
- name: Create Windows setup
run: iscc setup.iss
working-directory: windows
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: windows/Output/LargeCsvReaderSetup.exe
name: win_installer
create_release:
name: Create a release
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/v')
permissions:
contents: write
needs:
- package_windows
- package_linux
- package_macos
- build_rpm
- build_deb
- build_win_installer
steps:
- name: Extract Version Name
id: extract_name
uses: actions/github-script@v7
with:
result-encoding: string
script: |
return context.payload.ref.replace(/refs\/tags\/v/, '');
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Compress MacOS version
run: 7z a -tzip LargeCsvReader.zip LargeCsvReader.app
working-directory: artifacts
- name: Create a Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release ${{ steps.extract_name.outputs.result }}
draft: false
prerelease: false
generate_release_notes: true
fail_on_unmatched_files: true
body: |
For Windows:
- `LargeCsvReader.exe` (portable)
- `LargeCsvReaderSetup.exe` (installer)
For Linux:
- `LargeCsvReader-${{ steps.extract_name.outputs.result }}-1.x86_64.rpm` if your distribution supports RPM
- `LargeCsvReader_${{ steps.extract_name.outputs.result }}_amd64.deb` if your distribution supports DEB
- `LargeCsvReader.tar.xz` for all systems (extract it somewhere and run `sudo make install`)
For MacOS:
- `LargeCsvReader.zip`, extract `LargeCsvReader.app` anywhere you want and open it.
files: artifacts/*