Skip to content

Commit

Permalink
Use GitHub Actions (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
oznu authored Apr 11, 2020
1 parent aaf5c3b commit 66becd8
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 31 deletions.
5 changes: 3 additions & 2 deletions .ci/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash

set -x
set -e

cd /toolkit

# move build files into source dir
mkdir -p /toolkit/source
cp -R $TRAVIS_BUILD_DIR /toolkit/source/homebridge-syno-spk
cp -R $GITHUB_WORKSPACE /toolkit/source/homebridge-syno-spk

# build spk
./pkgscripts-ng/PkgCreate.py -c homebridge-syno-spk
./pkgscripts-ng/PkgCreate.py -c homebridge-syno-spk -S
7 changes: 4 additions & 3 deletions .ci/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash

set -x
set -e

PKG_VERSION=$(cat $TRAVIS_BUILD_DIR/INFO.sh | grep version | awk -F '"' '{ print $2 }')
PKG_VERSION=$(cat $GITHUB_WORKSPACE/INFO.sh | grep version | awk -F '"' '{ print $2 }')

mkdir $TRAVIS_BUILD_DIR/github-release
mkdir $GITHUB_WORKSPACE/github-release

cp /toolkit/result_spk/HomebridgeDocker-${PKG_VERSION}/HomebridgeDocker-x86_64-${PKG_VERSION}.spk $TRAVIS_BUILD_DIR/github-release/
cp /toolkit/result_spk/HomebridgeDocker-${PKG_VERSION}/HomebridgeDocker-x86_64-${PKG_VERSION}.spk $GITHUB_WORKSPACE/github-release/
24 changes: 1 addition & 23 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

set -x
set -e

# create base
mkdir /toolkit
Expand All @@ -11,26 +12,3 @@ git clone https://github.com/SynologyOpenSource/pkgscripts-ng.git

# deploy chroot env
./pkgscripts-ng/EnvDeploy -q -v 6.0 -p x64

# this gpg key is never going to be validated so it does not need to be secure
cat >foo <<EOF
Key-Type: RSA
Key-Length: 2048
Subkey-Type: RSA
Subkey-Length: 2048
Name-Real: @oznu
Name-Comment: not my real gpg key
Name-Email: [email protected]
Expire-Date: 0
%commit
%echo done
EOF

gpg --batch --gen-key foo

# copy gpg keys into chroot env
mkdir -p /toolkit/build_env/ds.x64-6.0/home/travis/
cp -R /home/travis/.gnupg /toolkit/build_env/ds.x64-6.0/root/.gnupg
cp -R /home/travis/.gnupg /toolkit/build_env/ds.x64-6.0/home/travis/.gnupg
chown -R root:root /toolkit/build_env/ds.x64-6.0/root/.gnupg /toolkit/build_env/ds.x64-6.0/home/travis/.gnupg
chmod -R 600 /toolkit/build_env/ds.x64-6.0/root/.gnupg /toolkit/build_env/ds.x64-6.0/home/travis/.gnupg
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Build"

on:
release:
types:
- created

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Environment
run: sudo -E ./.ci/setup.sh

- name: Build Package
run: sudo -E ./.ci/build.sh

- name: Deploy
run: sudo -E ./.ci/deploy.sh

- name: Get Release Asset File Name
id: get_release_asset_name
run: |
export ASSET_NAME=$(basename github-release/*.spk)
echo $ASSET_NAME
echo ::set-output name=ASSET_NAME::${ASSET_NAME}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: github-release/${{ steps.get_release_asset_name.outputs.ASSET_NAME }}
asset_name: ${{ steps.get_release_asset_name.outputs.ASSET_NAME }}
asset_content_type: application/gzip
4 changes: 2 additions & 2 deletions INFO.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
source /pkgscripts/include/pkg_util.sh

package="HomebridgeDocker"
version="1.0.7"
version="1.1.0"
maintainer="oznu"
displayname="Homebridge Docker"
displayname="Homebridge"
description="HomeKit support for the impatient using Docker on Synology DSM."
maintainer_url="https://github.com/oznu/docker-homebridge"
support_url="https://github.com/oznu/docker-homebridge/issues"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Pull requests are welcome.

## Setting up for development

See the [Synology DSM 6.0 Developer Guide](https://developer.synology.com/developer-guide/index.html).
See the [Synology DSM 6.0 Developer Guide](https://help.synology.com/developer-guide/).

## License

Expand Down

0 comments on commit 66becd8

Please sign in to comment.