Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Docker Image CI

on: [push, pull_request]

jobs:

make-flatpak:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Pull the Docker Image
run: docker pull alexandratr/scopy-flatpak-bionic:clean
- name: Run Docker Image
run: |
docker run --privileged \
-v `pwd`:$GITHUB_WORKSPACE:rw \
-e "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" \
alexandratr/scopy-flatpak-bionic:clean /bin/bash -xe $GITHUB_WORKSPACE/CI/appveyor/inside_flatpak_docker.sh
- uses: actions/upload-artifact@v2
with:
name: Scopy.flatpak
path: ${{ github.workspace }}/Scopy.flatpak
34 changes: 26 additions & 8 deletions CI/appveyor/inside_flatpak_docker.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/bin/sh -xe

if [ -n "$BRANCH" ]; then
ARTIFACT_LOCATION=/scopy
else
ARTIFACT_LOCATION=$GITHUB_WORKSPACE
fi

apt-get install -y jq

REPO_URL=https://github.com/"$REPO"
REPO_LOCAL=/home/docker/scopy-flatpak
cd "$REPO_LOCAL"
git pull && git checkout master
Expand All @@ -11,16 +16,29 @@ git pull && git checkout master
cnt=$( echo `jq '.modules | length' org.adi.Scopy.json` )
cnt=$(($cnt-1))

# use jq to replace the Scopy branch + the repo url used for building
# we want to build the branch and repo we're currently on
cat org.adi.Scopy.json | jq --tab '.modules['$cnt'].sources[0].branch = "'$BRANCH'"' > tmp.json
cp tmp.json org.adi.Scopy.json
cat org.adi.Scopy.json | jq --tab '.modules['$cnt'].sources[0].url = "'$REPO_URL'"' > tmp.json
if [ -n "$BRANCH" ]; then
REPO_URL=https://github.com/"$REPO"
# We are building in Appveyor and we have access to the current branch on a CACHED Docker image
# use jq to replace the Scopy branch + the repo url used for building
# we want to build the branch and repo we're currently on
cat org.adi.Scopy.json | jq --tab '.modules['$cnt'].sources[0].branch = "'$BRANCH'"' > tmp.json
cp tmp.json org.adi.Scopy.json
cat org.adi.Scopy.json | jq --tab '.modules['$cnt'].sources[0].url = "'$REPO_URL'"' > tmp.json
else
# We are building in Github Actions and we use the current directory folder on a CLEAN Docker image
cat org.adi.Scopy.json | jq --tab '.modules['$cnt'].sources[0].type = "dir"' > tmp.json
cp tmp.json org.adi.Scopy.json
cat org.adi.Scopy.json | jq --tab '.modules['$cnt'].sources[0].path = "'$GITHUB_WORKSPACE'"' > tmp.json
cp tmp.json org.adi.Scopy.json
cat org.adi.Scopy.json | jq --tab 'del(.modules['$cnt'].sources[0].url)' > tmp.json
cp tmp.json org.adi.Scopy.json
cat org.adi.Scopy.json | jq --tab 'del(.modules['$cnt'].sources[0].branch)' > tmp.json
fi
cp tmp.json org.adi.Scopy.json
rm tmp.json

make clean
make -j4

# Copy the Scopy.flatpak file in /scopy (which is the external location, mount when docker starts)
cp Scopy.flatpak /scopy/
# Copy the Scopy.flatpak file in $GITHUB_WORKSPACE (which is the external location, mount when docker starts)
cp Scopy.flatpak $ARTIFACT_LOCATION/