Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github actions for building configurator #1930

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
b400e52
Attempt github build
mmosca Dec 25, 2023
c432f10
Run on pull requests
mmosca Dec 25, 2023
8c2a307
Small changes
mmosca Dec 25, 2023
9be46df
add artifacts
mmosca Dec 25, 2023
188af6f
fix deps
mmosca Dec 25, 2023
383c4fe
create apps folder
mmosca Dec 25, 2023
d4a87af
increase verbosity
mmosca Dec 25, 2023
4443de6
List files
mmosca Dec 25, 2023
2056f79
List files
mmosca Dec 25, 2023
8b1663c
List files
mmosca Dec 25, 2023
66b45e0
List files
mmosca Dec 25, 2023
d27aada
Add --installer and rpm deps
mmosca Dec 25, 2023
a3b8b38
Split mac build, upload inidividual artifactsx
mmosca Dec 25, 2023
3b20a85
Split artifacts
mmosca Dec 25, 2023
fda8e8e
Use setup node
mmosca Dec 25, 2023
ff4ec50
Use setup node
mmosca Dec 25, 2023
2c0e522
Use setup node
mmosca Dec 25, 2023
3ec943a
Add windows
mmosca Dec 25, 2023
4390fec
Yaml fixes
mmosca Dec 25, 2023
5143fe1
s/lts/20/g
mmosca Dec 25, 2023
e1e8ec8
timeout mimnutes
mmosca Dec 25, 2023
53ffb29
try again
mmosca Dec 25, 2023
5f9d70b
try again
mmosca Dec 25, 2023
73a9992
Artifact names
mmosca Dec 25, 2023
2aa9fd7
Artifact names
mmosca Dec 25, 2023
5dc8e3d
Windows env
mmosca Dec 25, 2023
bef472a
Windows env
mmosca Dec 25, 2023
bbc575a
Windows bash
mmosca Dec 25, 2023
c96d16c
Debugging
mmosca Dec 25, 2023
c505cdd
Ubuntu
mmosca Dec 25, 2023
158dd90
Ubuntu
mmosca Dec 25, 2023
593240c
Don't rename .deb file, as the package follows the standard for .deb …
mmosca Dec 25, 2023
2d06680
Rename artifacts
mmosca Dec 25, 2023
fe3740c
node js versionx
mmosca Dec 25, 2023
b9514d9
change memory options for linux build
mmosca Dec 25, 2023
efa0823
Cleanup
mmosca Dec 25, 2023
dbaa058
Split build and
mmosca Dec 25, 2023
0d812a0
Upload tunning
mmosca Dec 25, 2023
8b9daf3
bump minimist version
mmosca Dec 26, 2023
39910c5
Merge branch 'master' into mmosca-github-build
mmosca Dec 26, 2023
5e19684
Fix master merge
mmosca Dec 26, 2023
54bb84d
update gulp depencies
mmosca Dec 26, 2023
73b5543
add --trace-deprecation
mmosca Dec 26, 2023
34e55ae
verbose debian package generation
mmosca Dec 26, 2023
77fe4f2
revert gulp-debian
mmosca Dec 26, 2023
196e43c
rever to gulp-debian 0.1.9
mmosca Dec 26, 2023
647e855
Update gulp-debian to 0.2.0
mmosca Dec 26, 2023
33767ef
Stick with gulp-debain 0.1.9 for now. 0.2.0 seems broken, as is the l…
mmosca Dec 26, 2023
02bf14a
Merge remote-tracking branch 'origin/master' into mmosca-github-build
mmosca Mar 5, 2024
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
183 changes: 183 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
on: pull_request


jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup environment
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
# This is the hash of the commit for the PR
# when the action is triggered by PR, empty otherwise
COMMIT_ID=${{ github.event.pull_request.head.sha }}
# This is the hash of the commit when triggered by push
# but the hash of refs/pull/<n>/merge, which is different
# from the hash of the latest commit in the PR, that's
# why we try github.event.pull_request.head.sha first
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
VERSION=$(grep version package.json | sed 's/.*"\([0-9][0-9]*.[0-9]*.[0-9]*\)".*/\1/g')
echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAME=inav-configurator-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
- uses: actions/setup-node@v4
with:
node-version: 21
check-latest: true
cache: 'npm'
- name: Install linux packages
run: sudo apt-get update && sudo apt-get install wine devscripts sbuild rpm
#- name: Download node.js
# run: curl -o /tmp/node.tar.xz https://nodejs.org/dist/v20.10.0/node-v20.10.0-linux-x64.tar.xz && sudo tar --strip-components=1 -xJvf /tmp/node.tar.xz -C /usr/local
- name: Install deps
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
command: npm install
timeout_minutes: 10
- name: Create apps folder
run: mkdir -p apps
- name: build linux64
id: build1
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
timeout_minutes: 20
command: node --trace-deprecation --max-old-space-size=4096 ./node_modules/gulp/bin/gulp.js clean && node --trace-deprecation --max-old-space-size=4096 ./node_modules/gulp/bin/gulp.js build
#continue-on-error: true
- name: linux64 release
id: release1
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
timeout_minutes: 20
command: node --trace-deprecation --max-old-space-size=4096 ./node_modules/gulp/bin/gulp.js release --platform=linux64 --installer
#continue-on-error: true

- name: Upload deb
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_NAME }} Linux64 deb
path: apps/*.deb
- name: Upload rpm
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_NAME }} Linux64 rpm
path: apps/*.rpm
- name: Upload linux binary
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_NAME }} Linux64 tar.gz
path: apps/*.tar.gz

build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup environment
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
# This is the hash of the commit for the PR
# when the action is triggered by PR, empty otherwise
COMMIT_ID=${{ github.event.pull_request.head.sha }}
# This is the hash of the commit when triggered by push
# but the hash of refs/pull/<n>/merge, which is different
# from the hash of the latest commit in the PR, that's
# why we try github.event.pull_request.head.sha first
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
VERSION=$(grep version package.json | sed 's/.*"\([0-9][0-9]*.[0-9]*.[0-9]*\)".*/\1/g')
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAME=inav-configurator-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
- uses: actions/setup-node@v4
with:
node-version: 21
check-latest: true
cache: 'npm'
- name: Install packages
run: brew install nodejs
#- name: Download node.js
# run: curl -o /tmp/node.pkg https://nodejs.org/dist/v20.10.0/node-v20.10.0.pkg && sudo installer -pkg /tmp/node.pkg -target /
- name: Install deps
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
command: npm install
timeout_minutes: 10
- name: Create apps folder
run: mkdir -p apps
- name: build macos release
run: node --trace-deprecation ./node_modules/gulp/bin/gulp.js release --platform=osx64
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAME}} MacOSX zip
path: apps/*.zip

build-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install linux utils
run: choco install --force -y awk grep sed
- name: Setup environment
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
# This is the hash of the commit for the PR
# when the action is triggered by PR, empty otherwise
COMMIT_ID=${{ github.event.pull_request.head.sha }}
# This is the hash of the commit when triggered by push
# but the hash of refs/pull/<n>/merge, which is different
# from the hash of the latest commit in the PR, that's
# why we try github.event.pull_request.head.sha first
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
VERSION=$(grep version package.json | sed 's/.*"\([0-9][0-9]*.[0-9]*.[0-9]*\)".*/\1/g')
echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAME=inav-configurator-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
shell: bash

- uses: actions/setup-node@v4
with:
node-version: 21
check-latest: true
cache: 'npm'
- name: Install deps
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
command: npm install
timeout_minutes: 10
- name: build win64 release
run: node --trace-deprecation ./node_modules/gulp/bin/gulp.js release --platform=win64 --installer
- name: Upload msi
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_NAME }} Windows 64 msi
path: apps/*.msi
- name: Upload exe
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_NAME }} Windows 64 exe
path: apps/*.exe
- name: Upload zip
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_NAME }} Windows 64 zip
path: apps/*.zip
compression-level: 0




15 changes: 2 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ function release_deb(arch) {
architecture: getLinuxPackageArch('deb', arch),
maintainer: metadata.author,
description: metadata.description,
preinst: [`rm -rf ${LINUX_INSTALL_DIR}/${metadata.name}`],
preinst: [`rm -rfv ${LINUX_INSTALL_DIR}/${metadata.name}`],
postinst: [
`chown root:root ${LINUX_INSTALL_DIR}`,
`chown -R root:root ${LINUX_INSTALL_DIR}/${metadata.name}`,
Expand All @@ -589,6 +589,7 @@ function release_deb(arch) {
_out: appsDir,
_copyright: 'assets/linux/copyright',
_clean: true,
_verbose: true
}));
}
}
Expand All @@ -599,18 +600,6 @@ function post_release_deb(arch) {
done();
return null;
}
if ((arch === 'linux32') || (arch === 'linux64')) {
var rename = require("gulp-rename");
const metadata = require('./package.json');
const renameFrom = path.join(appsDir, metadata.name + '_' + metadata.version + '_' + getLinuxPackageArch('.deb', arch) + '.deb');
const renameTo = path.join(appsDir, get_release_filename_base(arch) + '_' + metadata.version + '.deb');
// Rename .deb build to common naming
console.log(`Renaming .deb installer ${renameFrom} to ${renameTo}`);
return gulp.src(renameFrom)
.pipe(rename(renameTo))
.pipe(gulp.dest("."));
}

return done();
}
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"jquery-textcomplete": "^1.8.5",
"jquery-ui-npm": "1.12.0",
"marked": "^0.3.17",
"minimist": "^1.2.0",
"nw": "^0.61.0-sdk",
"minimist": "^1.2.8",
"nw": "^0.81.0",
"nw-dialog": "^1.0.7",
"openlayers": "^4.6.5",
"plotly": "^1.0.6",
Expand Down
Loading