Build rpm package #3
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: Build rpm package | |
on: | |
workflow_dispatch: | |
env: | |
FLUTTER_VERSION: "3.13.9" | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
outputs: | |
version: ${{ steps.get_version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get version from pubspec.yaml | |
id: get_version | |
run: | | |
VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' pubspec.yaml) | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
build_rpm_x86_64: | |
needs: [build] | |
runs-on: ubuntu-latest | |
container: fedora:38 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install dependencies | |
run: sudo dnf install -y clang cmake gtk3-devel ninja-build libappindicator-gtk3-devel jq findutils which git patchelf rpm-build | |
- name: Configure safe directory for Git | |
run: git config --global --add safe.directory /__t/flutter/stable-${{ env.FLUTTER_VERSION }}-x64 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: "stable" | |
- name: configure safe directory for git | |
run: git config --global --add safe.directory "/opt/hostedtoolcache/flutter/stable-${{ env.FLUTTER_VERSION }}-x64" | |
- name: get flutter path | |
run: which flutter | |
- name: get dart path | |
run: which dart | |
- name: enable dart_distributor | |
run: pub_cache=/opt/hostedtoolcache/flutter/stable-${{ env.FLUTTER_VERSION }}-x64/.pub-cache dart pub global activate flutter_distributor | |
- name: debugging path and flutter_distributor | |
run: | | |
echo "path: $path" | |
command -v flutter_distributor || echo "flutter_distributor not found" | |
# dodato: proverava direktorijum | |
- name: list files in working directory | |
run: ls -al | |
- name: build rpm package | |
working-directory: app # komentarisano jer 'app' možda nije ispravan | |
run: flutter_root=/opt/hostedtoolcache/flutter/stable-${{ env.FLUTTER_VERSION }}-x64 flutter_distributor package --platform linux --targets rpm | |
- name: find rpm file | |
id: find_rpm | |
run: | | |
rpm_path=$(find . -name "*.rpm" -print -quit) | |
echo "rpm_path=$rpm_path" >> $github_output | |
echo "rpm_name=$(basename "$rpm_path")" >> $github_output | |
- name: check if rpm file exists | |
id: check_file | |
run: | | |
if [[ ! -f "${{ steps.find_rpm.outputs.rpm_path }}" ]]; then | |
echo "file not found: ${{ steps.find_rpm.outputs.rpm_path }}" | |
exit 1 | |
fi | |
- name: upload rpm to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ${{ steps.find_rpm.outputs.rpm_path }} | |
asset_name: ${{ steps.find_rpm.outputs.rpm_name }} | |
asset_content_type: application/octet-stream | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |