Skip to content

Commit

Permalink
New publish and build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JezerM committed Feb 20, 2022
1 parent 5abe373 commit a6836d3
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 38 deletions.
60 changes: 60 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Action based on @MateuszStudiosCompany's web-greeter action
name: "Build nody-greeter"
description: "Builds nody-greeter"
inputs:
target-distro:
required: true
description: "Target distro"

runs:
using: "composite"
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Install dependencies
shell: bash
run: |
sudo apt update
sudo apt install python3 build-essential gobject-introspection liblightdm-gobject-1-dev libgirepository1.0-dev libcairo2-dev libxcb1-dev libx11-dev
sudo apt install dpkg
-
name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14
cache: npm
-
name: Install npm dependencies
shell: bash
run: npm install
-
name: Build nody-greeter
shell: bash
run: npm run build
-
name: Prepare deb build (common)
shell: bash
run: |
cp -r build/DEBIAN/ build/unpacked/
-
name: Prepare deb build (for Debian)
shell: bash
if: inputs.target-distro == "debian"
run: |
sed -i "s/liblightdm-gobject-1-dev/liblightdm-gobject-dev/g" build/unpacked/DEBIAN/control
-
name: Build deb
shell: bash
run: |
cd build/
dpkg-deb --root-owner-group --build unpacked "nody-greeter.deb"
dpkg --info "./nody-greeter.deb"
-
name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: nody-greeter-${{ input.target-distro }}
path: ./build/nody-greeter.deb
retention-days: 7
115 changes: 77 additions & 38 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,83 @@ on:
workflow_dispatch:

jobs:
build:
name: Publish binaries

publish-ubuntu:
name: Publish binaries (Ubuntu)
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Run build action
uses: "./.github/actions/build"
with:
target-distro: ubuntu
-
name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/nody-greeter.deb
asset_name: nody-greeter-$tag-ubuntu.deb
tag: ${{ github.ref }}
overwrite: true

publish-debian:
name: Publish binaries (Debian)
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Run build action
uses: "./.github/actions/build"
with:
target-distro: debian
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/nody-greeter.deb
asset_name: nody-greeter-$tag-debian.deb
tag: ${{ github.ref }}
overwrite: true

# This may be rewritten to not use external workflows
publish-void:
name: Publish binaries (Void)
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Install dependencies
run: |
sudo apt update
sudo apt install python3 build-essential gobject-introspection liblightdm-gobject-1-dev libgirepository1.0-dev libcairo2-dev libxcb1-dev libx11-dev
sudo apt install dpkg
-
name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14
cache: npm
-
name: Install npm dependencies
run: npm install
-
name: Build nody-greeter
run: npm run build
-
name: Build deb package
run: |
cd build/
cp -r DEBIAN/ unpacked/
dpkg-deb --root-owner-group --build unpacked "nody-greeter.deb"
dpkg --info "./nody-greeter.deb"
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/nody-greeter.deb
asset_name: nody-greeter-$tag.deb
tag: ${{ github.ref }}
overwrite: true
-
name: Checkout
uses: actions/checkout@v2
-
name: Dispatch void-linux build
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: build.yml
repo: JezerM/nody-greeter-void
ref: master
token: ${{ secrets.PERSONAL_TOKEN }}
inputs: "{}"
wait-for-completion: true
-
name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
repo: JezerM/nody-greeter-void
github_token: ${{ secrets.PERSONAL_TOKEN }}
workflow: build.yml
branch: master
path: artifacts/
-
name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: artifacts/**/*.xbps
file_glob: true
overwrite: true

0 comments on commit a6836d3

Please sign in to comment.