Skip to content

Commit

Permalink
Build manually in normal fashion rather than using pre-made action
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew J. Milner <[email protected]>
  • Loading branch information
matterhorn103 committed Nov 12, 2024
1 parent 56f5a18 commit b5f1e47
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
43 changes: 24 additions & 19 deletions .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,80 +6,85 @@ jobs:
flatpak:
name: "Flatpak"
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:kde-6.7
options: --privileged

steps:
- name: Install dependencies
run: sudo apt update -qq && sudo apt install -y -qq flatpak flatpak-builder

- name: Configure flatpak
run: flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo

- name: Checkout openchemistry
uses: actions/checkout@v4
with:
repository: openchemistry/openchemistry
submodules: false
path: src
path: openchemistry

- name: Checkout avogadroapp
uses: actions/checkout@v4
with:
path: src/avogadroapp
path: openchemistry/avogadroapp

- name: Checkout avogadrolibs
uses: actions/checkout@v4
with:
repository: openchemistry/avogadrolibs
path: src/avogadrolibs
path: openchemistry/avogadrolibs

- name: Checkout i18n
uses: actions/checkout@v4
with:
repository: openchemistry/avogadro-i18n
path: src/avogadro-i18n
path: openchemistry/avogadro-i18n

- name: Checkout avogadrogenerators
uses: actions/checkout@v4
with:
repository: openchemistry/avogenerators
path: src/avogadrogenerators
path: openchemistry/avogadrogenerators

- name: Checkout crystals
uses: actions/checkout@v4
with:
repository: openchemistry/crystals
path: src/crystals
path: openchemistry/crystals

- name: Checkout fragments
uses: actions/checkout@v4
with:
repository: openchemistry/fragments
path: src/fragments
path: openchemistry/fragments

- name: Checkout molecules
uses: actions/checkout@v4
with:
repository: openchemistry/molecules
path: src/molecules
path: openchemistry/molecules

- name: Checkout Flathub shared-modules
uses: actions/checkout@v4
with:
repository: flathub/shared-modules
path: shared-modules

- name: Setup tmate session
- name: Set up tmate session
if: failure()
uses: mxschmitt/action-tmate@v3

Check warning

Code scanning / Semgrep (reported by Codacy)

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Warning

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.

- name: Move manifest
run: mv src/avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml ./
run: mv openchemistry/avogadroapp/flatpak/org.openchemistry.Avogadro2.yaml ./

- name: Build with flatpak-builder
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
run: flatpak-builder --force-clean --user --install-deps-from=flathub --arch=x86_64 --default-branch=test --repo=repo builddir org.openchemistry.Avogadro2.yaml

- name: Create bundle
run: flatpak build-bundle repo Avogadro2.flatpak org.openchemistry.Avogadro2

- name: Upload bundle
uses: actions/upload-artifact@v4
with:
bundle: avogadro2.flatpak
branch: nightly
manifest-path: org.openchemistry.Avogadro2.yaml
cache: false
cache-key: flatpak-builder-${{ github.sha }}
path: Avogadro2.flatpak

- name: Cleanup
if: ${{ always() }} # To ensure this step runs even when earlier steps fail
Expand Down
6 changes: 3 additions & 3 deletions flatpak/org.openchemistry.Avogadro2.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
app-id: org.openchemistry.Avogadro2
default-branch: nightly
runtime: org.kde.Platform
sdk: org.kde.Sdk
runtime-version: "6.7"
Expand Down Expand Up @@ -48,9 +47,10 @@ modules:
sources:
# Avogadro stuff all already collected together as part of GitHub Actions
# This means that if using this to build the Flatpak locally, the openchemistry repo and
# its submodules must be cloned into ./src in advance of running flatpak-builder with this manifest
# its submodules must be cloned into ./openchemistry in advance of running flatpak-builder
# with this manifest
- type: dir
path: src
path: openchemistry

# Now fetch third-party stuff where the source is expected in `openchemistry/thirdparty`
# VTK
Expand Down

0 comments on commit b5f1e47

Please sign in to comment.