Skip to content

Commit 2d7c3ea

Browse files
authored
Merge pull request #14 from sparkfun/GitHub_Actions_from_kirk-sfe
Add GitHub Actions from kirk-sfe
2 parents bdc3a9a + 0bc527a commit 2d7c3ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3764
-1594
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: build-and-release
4+
5+
# Controls when the workflow will run
6+
on:
7+
8+
# Trigger on a push
9+
#push:
10+
11+
# Trigger on a published release
12+
release:
13+
types: [published]
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
19+
jobs:
20+
# Build the installer on mac
21+
call-macos-build:
22+
uses: ./.github/workflows/build-macos.yml
23+
24+
call-linux-build:
25+
uses: ./.github/workflows/build-linux.yml
26+
27+
call-windows-build:
28+
uses: ./.github/workflows/build-windows.yml
29+
30+
call-python-build:
31+
uses: ./.github/workflows/build-python.yml
32+
33+
# Using the outputs of the build
34+
deploy-builds:
35+
36+
# Only do this on a release - note - filtering release types in the above "on:" statement
37+
if: github.event_name == 'release'
38+
runs-on: ubuntu-latest
39+
needs: [call-macos-build, call-linux-build, call-windows-build, call-python-build]
40+
steps:
41+
# Download the generated app files that are part of the release
42+
- uses: actions/download-artifact@v3
43+
with:
44+
name: ${{ needs.call-macos-build.outputs.build-file }}
45+
- uses: actions/download-artifact@v3
46+
with:
47+
name: ${{ needs.call-linux-build.outputs.build-file }}
48+
- uses: actions/download-artifact@v3
49+
with:
50+
name: ${{ needs.call-windows-build.outputs.build-file }}
51+
- uses: actions/download-artifact@v3
52+
with:
53+
name: ${{ needs.call-python-build.outputs.build-file }}
54+
- name: Output Listing
55+
run: ls -la
56+
57+
- name: Publish Release
58+
uses: softprops/action-gh-release@v1
59+
with:
60+
files: |
61+
${{ needs.call-macos-build.outputs.build-file }}
62+
${{ needs.call-linux-build.outputs.build-file }}
63+
${{ needs.call-windows-build.outputs.build-file }}
64+
${{ needs.call-python-build.outputs.build-package }}
65+

.github/workflows/build-linux.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: build-linux
4+
5+
# Controls when the workflow will run
6+
on:
7+
# this is a called workflow
8+
workflow_call:
9+
outputs:
10+
build-file:
11+
description: "The output of this build procsss"
12+
value: ${{ jobs.linux-build-job.outputs.install-file }}
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# Build the installer on mac
17+
linux-build-job:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
# Output
22+
outputs:
23+
install-file: ${{ steps.output-installer.outputs.filename }}
24+
25+
# Steps represent a sequence of tasks that will be executed as part of the job
26+
steps:
27+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28+
- uses: actions/checkout@v3
29+
- uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.10'
32+
33+
# Setup python
34+
- name: System Setup
35+
run: |
36+
pip3 install pyserial pycryptodome pyinstaller pyqt5 darkdetect
37+
38+
# Build the installer
39+
- name: Build Linux Installer
40+
run: |
41+
pyinstaller --onefile --name ArtemisUploader --noconsole --distpath=. --icon=artemis_uploader/resource/artemis-uploader.ico --add-data="artemis_uploader/resource/*:resource/" artemis_upload.py
42+
gzip ArtemisUploader
43+
mv ArtemisUploader.gz ArtemisUploader.linux.gz
44+
45+
- uses: actions/upload-artifact@v3
46+
with:
47+
name: ArtemisUploader.linux.gz
48+
path: ArtemisUploader.linux.gz
49+
50+
- id: output-installer
51+
run: echo "::set-output name=filename::ArtemisUploader.linux.gz"
52+
53+

.github/workflows/build-macos.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: build-macos
4+
5+
# Controls when the workflow will run
6+
on:
7+
# this is a called workflow
8+
workflow_call:
9+
outputs:
10+
build-file:
11+
description: "The output of this build procsss"
12+
value: ${{ jobs.macos-build-job.outputs.install-file }}
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# Build the installer on mac
17+
macos-build-job:
18+
# The type of runner that the job will run on
19+
runs-on: macos-latest
20+
21+
# Output
22+
outputs:
23+
install-file: ${{ steps.output-installer.outputs.filename }}
24+
25+
# Steps represent a sequence of tasks that will be executed as part of the job
26+
steps:
27+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28+
- uses: actions/checkout@v3
29+
- uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.10'
32+
33+
# Setup python
34+
- name: System Setup
35+
run: |
36+
pip3 install pyserial pycryptodome pyinstaller Pillow pyqt5 darkdetect
37+
brew install create-dmg
38+
39+
# Build the installer
40+
- name: Build Mac Installer
41+
run: |
42+
pyinstaller --windowed -n ArtemisUploader --noconsole --distpath=. --icon=artemis_uploader/resource/artemis-uploader.ico --add-data="artemis_uploader/resource/*:resource/" artemis_upload.py
43+
mkdir tmp
44+
mv "ArtemisUploader.app" "tmp/"
45+
create-dmg --volicon "artemis_uploader/resource/sparkdisk.icns" --background "artemis_uploader/resource/sfe_logo_med.png" --hide-extension "ArtemisUploader.app" --icon "ArtemisUploader.app" 100 100 --window-size 600 440 --app-drop-link 400 100 "ArtemisUploader.dmg" "tmp/"
46+
47+
- uses: actions/upload-artifact@v3
48+
with:
49+
name: ArtemisUploader.dmg
50+
path: ArtemisUploader.dmg
51+
52+
- id: output-installer
53+
run: echo "::set-output name=filename::ArtemisUploader.dmg"
54+
55+

.github/workflows/build-python.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: build-python
4+
5+
# Controls when the workflow will run
6+
on:
7+
# this is a called workflow
8+
workflow_call:
9+
outputs:
10+
build-file:
11+
description: "The output of this build procsss"
12+
value: ${{ jobs.python-build-job.outputs.install-file }}
13+
build-package:
14+
description: "The output of this build procsss"
15+
value: ${{ jobs.python-build-job.outputs.install-package }}
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
# Build the installer on mac
20+
python-build-job:
21+
# The type of runner that the job will run on
22+
runs-on: ubuntu-latest
23+
24+
# Output
25+
outputs:
26+
install-file: ${{ steps.output-installer.outputs.filename }}
27+
install-package: ${{ steps.output-installer.outputs.packagename }}
28+
29+
# Steps represent a sequence of tasks that will be executed as part of the job
30+
steps:
31+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-python@v4
34+
with:
35+
python-version: '3.10'
36+
37+
# Setup python
38+
- name: System Setup
39+
run: |
40+
pip3 install setuptools
41+
42+
# Build the installer
43+
- name: Build Python Installer
44+
run: |
45+
python setup.py sdist
46+
47+
- uses: actions/upload-artifact@v3
48+
with:
49+
name: python-install-package
50+
path: dist
51+
52+
- name: Extract package name
53+
run: |
54+
cd dist
55+
echo "PACKAGE_NAME=$(ls *.tar.gz)" >> $GITHUB_ENV
56+
57+
- id: output-installer
58+
run: |
59+
echo "filename=python-install-package" >> $GITHUB_OUTPUT
60+
echo "packagename=${{ env.PACKAGE_NAME }}" >> $GITHUB_OUTPUT
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: build-windows
4+
5+
# Controls when the workflow will run
6+
on:
7+
# this is a called workflow
8+
workflow_call:
9+
outputs:
10+
build-file:
11+
description: "The output of this build procsss"
12+
value: ${{ jobs.windows-build-job.outputs.install-file }}
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# Build the installer on mac
17+
windows-build-job:
18+
# The type of runner that the job will run on
19+
runs-on: windows-latest
20+
21+
# Output
22+
outputs:
23+
install-file: ${{ steps.output-installer.outputs.filename }}
24+
25+
# Steps represent a sequence of tasks that will be executed as part of the job
26+
steps:
27+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28+
- uses: actions/checkout@v3
29+
- uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.10'
32+
33+
# Setup python
34+
- name: System Setup
35+
run: |
36+
pip3 install pyserial pycryptodome pyinstaller pyqt5 darkdetect
37+
38+
# Build the installer
39+
- name: Build Windows Installer
40+
run: |
41+
pyinstaller --onefile --name ArtemisUploader --noconsole --distpath=. --icon=artemis_uploader\resource\artemis-uploader.ico --add-data="artemis_uploader\resource\*;resource\" artemis_upload.py
42+
43+
- name: Compress Installer
44+
shell: powershell
45+
run: |
46+
$compress = @{
47+
Path = ".\ArtemisUploader.exe"
48+
CompressionLevel = "Fastest"
49+
DestinationPath = ".\ArtemisUploader.win.zip"
50+
}
51+
Compress-Archive @compress
52+
53+
- uses: actions/upload-artifact@v3
54+
with:
55+
name: ArtemisUploader.win.zip
56+
path: ArtemisUploader.win.zip
57+
58+
- id: output-installer
59+
run: echo "::set-output name=filename::ArtemisUploader.win.zip"
60+
61+
62+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Workflow that builds the application, but doens't add to a release.
2+
#
3+
# This will run on a push that doesn't have a vesion (release) tag
4+
5+
name: non-release-build
6+
7+
# Controls when the workflow will run
8+
on:
9+
# Trigger on push - when a version tag isn't set
10+
# push:
11+
# branches:
12+
# - master
13+
# tags-ignore:
14+
# - "v*.*.*"
15+
16+
# Allows you to run this workflow manually from the Actions tab
17+
workflow_dispatch:
18+
19+
# Run each plaform build workflows as seperate jobs
20+
jobs:
21+
# Build the installer on mac
22+
call-macos-build:
23+
uses: ./.github/workflows/build-macos.yml
24+
25+
call-linux-build:
26+
uses: ./.github/workflows/build-linux.yml
27+
28+
call-windows-build:
29+
uses: ./.github/workflows/build-windows.yml
30+
31+
call-python-build:
32+
uses: ./.github/workflows/build-python.yml

DESCRIPTION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The Artemis Firmware Uploader (AFU) is a simple to use GUI for updating firmware and the bootloader on Artemis based products.
-5.64 MB
Binary file not shown.

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include artemis_uploader/resource/*.*
2+
include DESCRIPTION.md

OSX/artemis_firmware_uploader_gui

-41.3 MB
Binary file not shown.

0 commit comments

Comments
 (0)