From e44da07749f82fe4e59ad512533cfcc1f34abc08 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Sun, 8 Nov 2020 15:15:17 +0100 Subject: [PATCH 1/2] Adding CI --- .github/workflows/packaging_test.yml | 35 +++++++++++++++ .github/workflows/release.yml | 66 ++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 .github/workflows/packaging_test.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/packaging_test.yml b/.github/workflows/packaging_test.yml new file mode 100644 index 0000000..be8a5c4 --- /dev/null +++ b/.github/workflows/packaging_test.yml @@ -0,0 +1,35 @@ +name: Packaging Test + +on: + push: + branches: + - $default-branch + - development + - master + # Run tests for any PRs + pull_request: + +env: + SOURCE_DIR: ./ + ARTIFACTS_DIR: debian/build/release/ + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + env: + DEBIAN_FRONTEND: "noninteractive" + - name: Remove github artefacts + run: | + rm -rf .github/ + - name: Adjust distibution in changelog file + run: | + sed -i '0,/restricted/s//stable/' debian/changelog + - name: Build Debian package + uses: pi-top/action-debian-package@v4 + with: + artifacts_directory: debian/build/release/ + - name: Debug + run: | + ls -la diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e1a5be8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'debian/*' # Push events to matching debian/*, i.e. debian/1.0-2, debian/20.15.10, debian/23.20020326 + +name: Release Process + +env: + SOURCE_DIR: ./ + ARTIFACTS_DIR: debian/build/release/ + +jobs: + create-release: + name: Create Release + runs-on: ubuntu-latest + outputs: + release-id: ${{ steps.create_release.outputs.id }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Install needed packages + run: | + if [ $(dpkg -l | grep -c dpkg-dev) -ne 1 ]; then sudo apt-get update && sudo apt-get install -y dpkg-dev; fi + - name: Gather changelog + run: | + ls -la + dpkg-parsechangelog | tail -n +9 > debian.changelog + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body_path: debian.changelog + draft: false + prerelease: false + + build: + name: Build and upload packages + needs: create-release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + env: + DEBIAN_FRONTEND: "noninteractive" + - name: Remove github artefacts + run: | + rm -rf .github/ + - name: Adjust distibution in changelog file + run: | + sed -i '0,/restricted/s//stable/' debian/changelog + - name: Build Debian package + uses: pi-top/action-debian-package@v4 + with: + artifacts_directory: debian/build/release/ + target_architectures: "amd64,i386" + - name: Upload the artifacts + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + releaseId: ${{ needs.create-release.outputs.release-id }} + args: debian/build/release/* From 7065705c8844db8ab4e03cb5b3bbe9b8243a8d7c Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Sun, 8 Nov 2020 15:21:20 +0100 Subject: [PATCH 2/2] Removing .travis.yml --- .travis.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e5c59ff..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -sudo: required -dist: xenial - -matrix: - include: - - env: TRAVIS_DEBIAN_DISTRIBUTION=unstable - - env: TRAVIS_DEBIAN_DISTRIBUTION=testing - - env: TRAVIS_DEBIAN_DISTRIBUTION=stable - allow_failures: - - env: TRAVIS_DEBIAN_DISTRIBUTION=stable - -services: - - docker - -script: - # build the debian package - - wget -O- http://travis.debian.net/script.sh | sh - - -#notifications: -# email: false - -branches: - except: - - /^debian\/\d/