Skip to content

Commit

Permalink
Generate APT repo for releases and under dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Nov 15, 2020
1 parent a494e1d commit 4b986a1
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 4 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2

- name: Installing build dependencies
run: apt-get update && apt-get install -y git
run: apt-get update && apt-get install -y git make sed gzip fakeroot lintian dpkg-dev
- name: Installing runtime dependencies
run: apt-get install -y xvfb
- name: Install Docker
Expand Down Expand Up @@ -45,6 +45,8 @@ jobs:

- name: Build ckan.exe and netkan.exe
run: ./build --configuration=Release
- name: Build deb
run: ./build deb --configuration=Release --exclusive
- name: Run tests
run: xvfb-run ./build test+only --configuration=Release --where="Category!=FlakyNetwork"

Expand All @@ -59,7 +61,7 @@ jobs:
run: |
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
./build docker-inflator --exclusive
- name: Push to S3
- name: Push ckan.exe and netkan.exe to S3
# Send ckan.exe and netkan.exe to https://ksp-ckan.s3-us-west-2.amazonaws.com/
uses: jakejarvis/s3-sync-action@master
with:
Expand All @@ -71,6 +73,19 @@ jobs:
AWS_REGION: us-east-1
SOURCE_DIR: _build/repack/Release
if: ${{ env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY }}
- name: Push deb to S3
# Send deb file to https://ksp-ckan.s3-us-west-2.amazonaws.com/
uses: jakejarvis/s3-sync-action@master
with:
args: --follow-symlinks
env:
AWS_S3_BUCKET: ksp-ckan
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
SOURCE_DIR: _build/deb/apt-repo
DEST_DIR: deb/dists/nightly/main/binary-all
if: ${{ env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY }}

- name: Send Discord Notification
env:
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2

- name: Installing build dependencies
run: apt-get update && apt-get install -y git make sed libplist-utils xorriso gzip fakeroot lintian rpm wget jq
run: apt-get update && apt-get install -y git make sed libplist-utils xorriso gzip fakeroot lintian rpm wget jq dpkg-dev
- name: Installing runtime dependencies
run: apt-get install -y xvfb
- name: Restore cache for _build/tools
Expand Down Expand Up @@ -105,6 +105,19 @@ jobs:
asset_path: _build/out/AutoUpdater/Release/bin/AutoUpdater.exe
asset_name: AutoUpdater.exe
asset_content_type: application/vnd.microsoft.portable-executable
- name: Push deb to S3
# Send deb file to https://ksp-ckan.s3-us-west-2.amazonaws.com/
uses: jakejarvis/s3-sync-action@master
with:
args: --follow-symlinks
env:
AWS_S3_BUCKET: ksp-ckan
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
SOURCE_DIR: _build/deb/apt-repo
DEST_DIR: deb/dists/stable/main/binary-all
if: ${{ env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY }}

- name: Send Discord Notification
env:
Expand Down
22 changes: 21 additions & 1 deletion debian/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean test
.PHONY: clean test repo

DESTDIR:=../_build/deb/fakeroot
EXESRC:=../_build/repack/Release/ckan.exe
Expand All @@ -23,6 +23,26 @@ CONSOLEUIDESKTOPSRC:=ckan-consoleui.desktop
CONSOLEUIDESKTOPDEST:=$(DESTDIR)/usr/share/applications/ckan-consoleui.desktop
VERSION:=$(shell egrep '^\s*\#\#\s+v.*$$' $(CHANGELOGSRC) | head -1 | sed -e 's/^\s*\#\#\s\+v//' )
DEB:=../_build/deb/ckan_$(VERSION)_all.deb
APTREPO:=../_build/deb/apt-repo
REPODEB:=$(APTREPO)/ckan_$(VERSION)_all.deb
PACKAGES:=$(APTREPO)/Packages.gz
RELEASESRC:=Release.in
RELEASEDEST:=$(APTREPO)/Release

repo: $(REPODEB) $(PACKAGES) $(RELEASEDEST)

$(REPODEB): $(DEB)
umask 0022 && mkdir -p $(shell dirname $@)
umask 0022 && cp $< $@

# For https://ksp-ckan.s3-us-west-2.amazonaws.com/ ?
$(PACKAGES): $(REPODEB)
umask 0022 && mkdir -p $(shell dirname $@)
umask 0022 && (cd $(shell dirname $<) && dpkg-scanpackages -m .) | gzip -c > $@

$(RELEASEDEST): $(RELEASESRC)
umask 0022 && mkdir -p $(shell dirname $@)
umask 0022 && sed -e 's/@VERSION@/$(VERSION)/' $< > $@

$(DEB): $(EXEDEST) $(SCRIPTDEST) $(CONTROLDEST) $(CHANGELOGDEST) $(DEBCHANGEDEST) $(MANDEST) $(ICONDEST) $(COPYRIGHTDEST) $(DESKTOPDEST) $(CONSOLEUIDESKTOPDEST)
umask 0022 && mkdir -p $(shell dirname $@)
Expand Down
4 changes: 4 additions & 0 deletions debian/Release.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Components: main
Architectures: all
Description: Packages of the latest releases of the KSP-CKAN official client
Version: @VERSION@

0 comments on commit 4b986a1

Please sign in to comment.