2021-09-26 14:42:50 +02:00
|
|
|
name: build
|
2021-02-14 22:19:38 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-03-04 15:29:10 +01:00
|
|
|
branches:
|
2021-09-25 23:46:53 +02:00
|
|
|
- main
|
2023-02-11 11:17:55 +01:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2021-02-14 22:19:38 +01:00
|
|
|
release:
|
2021-09-25 23:46:53 +02:00
|
|
|
types:
|
|
|
|
- created
|
2021-02-14 22:19:38 +01:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2023-03-12 00:23:43 +01:00
|
|
|
build-firmware:
|
2021-02-14 22:19:38 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-02-24 23:27:34 +01:00
|
|
|
- name: Download SummerCart64 repository
|
2024-03-04 12:55:47 +01:00
|
|
|
uses: actions/checkout@v4
|
2023-02-24 23:27:34 +01:00
|
|
|
|
2023-03-12 00:23:43 +01:00
|
|
|
- name: Set package version
|
2023-02-24 23:27:34 +01:00
|
|
|
uses: frabert/replace-string-action@v2
|
2023-03-12 00:23:43 +01:00
|
|
|
id: version
|
2021-02-14 22:19:38 +01:00
|
|
|
with:
|
2023-02-24 23:27:34 +01:00
|
|
|
pattern: '\/'
|
2023-03-12 00:23:43 +01:00
|
|
|
string: '${{ github.ref_name }}'
|
2023-02-24 23:27:34 +01:00
|
|
|
replace-with: '-'
|
2023-02-11 10:42:18 +01:00
|
|
|
|
2023-03-12 00:23:43 +01:00
|
|
|
- name: Build firmware
|
2021-11-16 22:37:48 +01:00
|
|
|
run: ./docker_build.sh release --force-clean
|
2023-02-24 23:27:34 +01:00
|
|
|
env:
|
2023-03-12 00:23:43 +01:00
|
|
|
SC64_VERSION: ${{ steps.version.outputs.replaced }}
|
2021-02-14 22:19:38 +01:00
|
|
|
|
|
|
|
- name: Upload artifact
|
2024-03-04 12:55:47 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-02-14 22:19:38 +01:00
|
|
|
with:
|
2023-03-12 00:23:43 +01:00
|
|
|
name: sc64-pkg-${{ steps.version.outputs.replaced }}
|
2023-02-24 23:27:34 +01:00
|
|
|
path: |
|
2023-03-12 00:23:43 +01:00
|
|
|
sc64-extra-${{ steps.version.outputs.replaced }}.zip
|
|
|
|
sc64-firmware-${{ steps.version.outputs.replaced }}.bin
|
2021-02-14 22:19:38 +01:00
|
|
|
|
2023-02-24 23:27:34 +01:00
|
|
|
- name: Upload release assets
|
2021-02-14 22:19:38 +01:00
|
|
|
if: github.event_name == 'release' && github.event.action == 'created'
|
2023-02-24 23:27:34 +01:00
|
|
|
uses: softprops/action-gh-release@v0.1.15
|
|
|
|
with:
|
|
|
|
files: |
|
2023-03-12 00:23:43 +01:00
|
|
|
sc64-extra-${{ steps.version.outputs.replaced }}.zip
|
|
|
|
sc64-firmware-${{ steps.version.outputs.replaced }}.bin
|
2023-02-24 23:27:34 +01:00
|
|
|
|
2023-03-12 00:23:43 +01:00
|
|
|
build-deployer:
|
2023-02-24 23:27:34 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-12-17 21:11:20 +01:00
|
|
|
version: [windows, windows-32bit, linux, macos]
|
2023-02-24 23:27:34 +01:00
|
|
|
include:
|
2023-12-17 21:11:20 +01:00
|
|
|
- version: windows
|
|
|
|
os: windows-latest
|
|
|
|
executable: target/release/sc64deployer.exe
|
|
|
|
package-name: sc64-deployer-windows
|
|
|
|
package-params: -c -a -f
|
|
|
|
package-extension: zip
|
|
|
|
|
|
|
|
- version: windows-32bit
|
|
|
|
os: windows-latest
|
|
|
|
build-params: --target=i686-pc-windows-msvc
|
|
|
|
executable: target/i686-pc-windows-msvc/release/sc64deployer.exe
|
|
|
|
package-name: sc64-deployer-windows-32bit
|
|
|
|
package-params: -c -a -f
|
|
|
|
package-extension: zip
|
|
|
|
|
|
|
|
- version: linux
|
|
|
|
os: ubuntu-latest
|
2023-03-12 00:23:43 +01:00
|
|
|
linux-packages: libudev-dev
|
2023-12-17 21:11:20 +01:00
|
|
|
executable: target/release/sc64deployer
|
|
|
|
package-name: sc64-deployer-linux
|
|
|
|
package-params: -czf
|
|
|
|
package-extension: tar.gz
|
|
|
|
|
|
|
|
- version: macos
|
|
|
|
os: macos-latest
|
|
|
|
executable: target/release/sc64deployer
|
|
|
|
package-name: sc64-deployer-macos
|
|
|
|
package-params: -czf
|
|
|
|
package-extension: tgz
|
2021-02-14 22:19:38 +01:00
|
|
|
|
2023-02-24 23:27:34 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Download SummerCart64 repository
|
2024-03-04 12:55:47 +01:00
|
|
|
uses: actions/checkout@v4
|
2023-02-24 23:27:34 +01:00
|
|
|
|
2023-03-12 00:23:43 +01:00
|
|
|
- name: Set package version
|
2023-02-24 23:27:34 +01:00
|
|
|
uses: frabert/replace-string-action@v2
|
2023-03-12 00:23:43 +01:00
|
|
|
id: version
|
2023-02-24 23:27:34 +01:00
|
|
|
with:
|
|
|
|
pattern: '\/'
|
2023-03-12 00:23:43 +01:00
|
|
|
string: '${{ github.ref_name }}'
|
2023-02-24 23:27:34 +01:00
|
|
|
replace-with: '-'
|
|
|
|
|
2023-03-12 00:23:43 +01:00
|
|
|
- name: Install linux packages
|
|
|
|
if: matrix.linux-packages
|
2023-02-24 23:27:34 +01:00
|
|
|
run: |
|
2023-03-12 00:23:43 +01:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get -y install ${{ matrix.linux-packages }}
|
|
|
|
|
|
|
|
- name: Build deployer
|
2023-12-17 21:11:20 +01:00
|
|
|
run: cargo b -r ${{ matrix.build-params }}
|
2023-03-12 00:23:43 +01:00
|
|
|
working-directory: sw/deployer
|
2023-02-24 23:27:34 +01:00
|
|
|
|
|
|
|
- name: Package executable
|
|
|
|
run: |
|
2023-12-17 21:11:20 +01:00
|
|
|
mkdir -p ./package
|
|
|
|
cp ${{ matrix.executable }} ./package/
|
|
|
|
cd ./package
|
|
|
|
tar ${{ matrix.package-params }} ./${{ matrix.package-name }}-${{ steps.version.outputs.replaced }}.${{ matrix.package-extension }} *
|
2023-03-12 00:23:43 +01:00
|
|
|
working-directory: sw/deployer
|
2023-02-24 23:27:34 +01:00
|
|
|
|
|
|
|
- name: Upload artifact
|
2024-03-04 12:55:47 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-02-24 23:27:34 +01:00
|
|
|
with:
|
2023-12-17 21:11:20 +01:00
|
|
|
name: ${{ matrix.package-name }}-${{ steps.version.outputs.replaced }}
|
|
|
|
path: sw/deployer/package/${{ matrix.package-name }}-${{ steps.version.outputs.replaced }}.${{ matrix.package-extension }}
|
2023-02-24 23:27:34 +01:00
|
|
|
|
|
|
|
- name: Upload release assets
|
2021-02-14 22:19:38 +01:00
|
|
|
if: github.event_name == 'release' && github.event.action == 'created'
|
2023-02-24 23:27:34 +01:00
|
|
|
uses: softprops/action-gh-release@v0.1.15
|
2021-02-14 22:19:38 +01:00
|
|
|
with:
|
2023-02-24 23:27:34 +01:00
|
|
|
files: |
|
2023-12-17 21:11:20 +01:00
|
|
|
sw/deployer/package/${{ matrix.package-name }}-${{ steps.version.outputs.replaced }}.${{ matrix.package-extension }}
|
2024-01-07 19:21:11 +01:00
|
|
|
|
|
|
|
publish-website:
|
2024-03-04 15:29:10 +01:00
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
|
2024-01-07 19:25:47 +01:00
|
|
|
permissions:
|
2024-03-04 15:29:10 +01:00
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
2024-01-07 19:21:11 +01:00
|
|
|
|
|
|
|
steps:
|
2024-03-04 15:29:10 +01:00
|
|
|
- name: Download SummerCart64 repository
|
|
|
|
uses: actions/checkout@v4
|
2024-01-07 19:25:47 +01:00
|
|
|
|
2024-03-04 15:29:10 +01:00
|
|
|
- name: Setup GitHub pages
|
|
|
|
uses: actions/configure-pages@v4
|
|
|
|
|
|
|
|
- name: Upload website artifact
|
|
|
|
uses: actions/upload-pages-artifact@v3
|
2024-01-07 19:21:11 +01:00
|
|
|
with:
|
2024-03-04 15:29:10 +01:00
|
|
|
path: ./web
|
|
|
|
|
|
|
|
- name: Publish website from uploaded artifact
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v4
|