Skip to content

Fix Ubuntu CI Permissions Issue #54

Fix Ubuntu CI Permissions Issue

Fix Ubuntu CI Permissions Issue #54

Workflow file for this run

name: Ubuntu CI Build
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
types: [opened, reopened, synchronize]
jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
steps:
- name: Install Dependencies
id: init
run: |
echo "wxVer=3.2.4" >> $GITHUB_OUTPUT
sudo apt update
sudo apt install -y --no-install-recommends \
cmake build-essential libssl-dev gettext git pkg-config lsb-release file ccache \
libgtk-3-dev liblua5.3-dev libcurl4-openssl-dev libwebkit2gtk-4.0-dev wget appstream fuse
- name: Restore wxWidgets Cache
id: restore-cache-wxWidgets
uses: actions/cache/restore@v4
with:
path: /home/runner/work/wxWidgets
key: wxWidgets-${{steps.init.outputs.wxVer}}-${{ matrix.os }}
- name: Build wxWidgets
if: steps.restore-cache-wxWidgets.outputs.cache-hit != 'true'
run: |
cd /home/runner/work
wget https://github.com/wxWidgets/wxWidgets/releases/download/v${{steps.init.outputs.wxVer}}/wxWidgets-${{steps.init.outputs.wxVer}}.tar.bz2
tar -xjf wxWidgets-${{steps.init.outputs.wxVer}}.tar.bz2
mv wxWidgets-${{steps.init.outputs.wxVer}} wxWidgets
cd wxWidgets
mkdir build-linux && cd build-linux
../configure --disable-shared --enable-cxx11 --with-cxx=11 --enable-webview --with-gtk=3 --enable-unicode --enable-intl
make -j$(nproc)
- name: Save wxWidgets Cache
if: steps.restore-cache-wxWidgets.outputs.cache-hit != 'true'
id: save-cache-wxWidgets
uses: actions/cache/save@v4
with:
path: /home/runner/work/wxWidgets
key: wxWidgets-${{steps.init.outputs.wxVer}}-${{ matrix.os }}
- name: Install wxWidgets
run: |
cd /home/runner/work/wxWidgets/build-linux
sudo make install
sudo ldconfig
- name: Checkout latest release
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build MoneyManagerEx
id: mmex-build
run: |
cd $GITHUB_WORKSPACE
mkdir build
cd build
cmake ..
export MAKEFLAGS=-j$(nproc)
cmake --build . --target package
mkdir /home/runner/work/moneymanagerex/moneymanagerex/build/AppDir
make install DESTDIR=/home/runner/work/moneymanagerex/moneymanagerex/build/AppDir
echo "artifact_name=$(ls mmex*.deb)" >> $GITHUB_OUTPUT
- name: Upload DEB Package
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.mmex-build.outputs.artifact_name }}
path: ${{ github.workspace }}/build/mmex*.deb
- name: Install Sigstore Python dependencies
if: ${{ github.event_name == 'push' }}
run: python -m pip install email-validator
- name: Sign and Upload DEB
if: ${{ github.event_name == 'push' }}
uses: sigstore/gh-action-sigstore-python@v2.1.1
with:
inputs: ${{ github.workspace }}/build/mmex*.deb
upload-signing-artifacts: true
- name: Generate AppImage
if: ${{ matrix.os == 'ubuntu-20.04' }}
id: appimage-build
run: |
cd /home/runner/work/moneymanagerex/moneymanagerex/build
wget -O appimage-builder https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder
cp ../.appimage-builder.yml .
sed -i "s/version: latest/version: $(grep '^Version ' ../NEWS | head -n 1 | sed 's/Version //;s/ /-/;s/ /./')/" .appimage-builder.yml
./appimage-builder --recipe .appimage-builder.yml
echo "artifact_name=$(ls MMEX*.AppImage)" >> $GITHUB_OUTPUT
- name: Upload AppImage
if: ${{ matrix.os == 'ubuntu-20.04' && github.event_name == 'pull_request'}}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.appimage-build.outputs.artifact_name }}
path: ${{ github.workspace }}/build/MMEX*.AppImage
- name: Sign and Upload AppImage
if: ${{ matrix.os == 'ubuntu-20.04' && github.event_name == 'push'}}
uses: sigstore/gh-action-sigstore-python@v2.1.1
with:
inputs: ${{ github.workspace }}/build/MMEX*.AppImage
upload-signing-artifacts: true