diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b0b8acbc7a..0f2201f5cc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 @@ -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" @@ -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: @@ -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: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dae1fb260e..c807892320 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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: diff --git a/debian/Makefile b/debian/Makefile index 9392889183..bd974edde4 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -1,4 +1,4 @@ -.PHONY: clean test +.PHONY: clean test repo DESTDIR:=../_build/deb/fakeroot EXESRC:=../_build/repack/Release/ckan.exe @@ -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): $(DEB) + 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 $@) diff --git a/debian/Release.in b/debian/Release.in new file mode 100644 index 0000000000..0dea688fae --- /dev/null +++ b/debian/Release.in @@ -0,0 +1,4 @@ +Components: main +Architectures: all +Description: Packages of the latest releases of the KSP-CKAN official client +Version: @VERSION@