Build and and deploy DSF packages #145
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and and deploy DSF packages | |
on: | |
workflow_dispatch: | |
inputs: | |
target: | |
description: "Deployment target" | |
required: true | |
default: "dev" | |
type: choice | |
options: | |
- dev | |
- unstable-3.6 | |
- stable-3.6 | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
# Install NodeJS environment | |
- name: Set up NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
# Install .NET environment | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8 | |
# Install required tools | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y dpkg-sig libxml2-utils | |
# Import GPG key for package signing | |
- name: Configure GPG key | |
run: | | |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import | |
env: | |
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
# Build DSF | |
- name: Build DSF packages | |
run: | | |
cd pkg | |
./build.sh --signing-key=C406404B2459FE0B1C6CC19D3738126EDA91C86B --target-arch=armhf --dest-dir=./out | |
./build.sh --signing-key=C406404B2459FE0B1C6CC19D3738126EDA91C86B --target-arch=arm64 --dest-dir=./out | |
# Upload packages to dev feed | |
- name: Upload packages to dev feed | |
uses: Creepios/sftp-action@v1.0.5 | |
with: | |
host: pkg.duet3d.com | |
port: 22 | |
username: ${{ secrets.PKG_SSH_USER }} | |
password: ${{ secrets.PKG_SSH_PASS }} | |
privateKey: ${{ secrets.PKG_SSH_KEY }} | |
localPath: ./pkg/out | |
remotePath: /var/www/pkg/dists/dev/armv7 | |
# Update package lists on dev feed | |
- name: Update package lists on dev feed | |
uses: appleboy/ssh-action@v0.1.7 | |
with: | |
host: pkg.duet3d.com | |
username: ${{ secrets.PKG_SSH_USER }} | |
key: ${{ secrets.PKG_SSH_KEY }} | |
script: update-pkg-feed dev | |
# Upload stable packages to stable feed | |
- name: Upload stable packages to stable feed | |
if: startsWith(inputs.target, 'stable') | |
uses: Creepios/sftp-action@v1.0.5 | |
with: | |
host: pkg.duet3d.com | |
port: 22 | |
username: ${{ secrets.PKG_SSH_USER }} | |
password: ${{ secrets.PKG_SSH_PASS }} | |
privateKey: ${{ secrets.PKG_SSH_KEY }} | |
localPath: ./pkg/out | |
remotePath: /var/www/pkg/dists/stable/armv7 | |
# Upload (un)stable packages to unstable feed | |
- name: Upload (un)stable packages to unstable feed | |
if: startsWith(inputs.target, 'stable') || startsWith(inputs.target, 'unstable') | |
uses: Creepios/sftp-action@v1.0.5 | |
with: | |
host: pkg.duet3d.com | |
port: 22 | |
username: ${{ secrets.PKG_SSH_USER }} | |
password: ${{ secrets.PKG_SSH_PASS }} | |
privateKey: ${{ secrets.PKG_SSH_KEY }} | |
localPath: ./pkg/out | |
remotePath: /var/www/pkg/dists/unstable/armv7 | |
# Upload stable packages to specific stable feed | |
- name: Upload stable packages to specific stable feed | |
if: startsWith(inputs.target, 'stable') | |
uses: Creepios/sftp-action@v1.0.5 | |
with: | |
host: pkg.duet3d.com | |
port: 22 | |
username: ${{ secrets.PKG_SSH_USER }} | |
password: ${{ secrets.PKG_SSH_PASS }} | |
privateKey: ${{ secrets.PKG_SSH_KEY }} | |
localPath: ./pkg/out | |
remotePath: /var/www/pkg/dists/${{ inputs.target }}/armv7 | |
# Upload stable packages to specific unstable feed | |
- name: Upload stable packages to specific unstable feed | |
if: startsWith(inputs.target, 'stable') | |
uses: Creepios/sftp-action@v1.0.5 | |
with: | |
host: pkg.duet3d.com | |
port: 22 | |
username: ${{ secrets.PKG_SSH_USER }} | |
password: ${{ secrets.PKG_SSH_PASS }} | |
privateKey: ${{ secrets.PKG_SSH_KEY }} | |
localPath: ./pkg/out | |
remotePath: /var/www/pkg/dists/un${{ inputs.target }}/armv7 | |
# Upload unstable packages to specific unstable feed | |
- name: Upload unstable packages to specific unstable feed | |
if: startsWith(inputs.target, 'unstable') | |
uses: Creepios/sftp-action@v1.0.5 | |
with: | |
host: pkg.duet3d.com | |
port: 22 | |
username: ${{ secrets.PKG_SSH_USER }} | |
password: ${{ secrets.PKG_SSH_PASS }} | |
privateKey: ${{ secrets.PKG_SSH_KEY }} | |
localPath: ./pkg/out | |
remotePath: /var/www/pkg/dists/${{ inputs.target }}/armv7 | |