Skip to content

Commit

Permalink
Merge pull request #179 from walkero-gr/enh-drone-pr
Browse files Browse the repository at this point in the history
Added automatic releases
  • Loading branch information
walkero-gr authored Nov 6, 2022
2 parents 6cccb39 + c58c720 commit cfe4642
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 11 deletions.
171 changes: 164 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
kind: pipeline
type: docker
name: drone-agents-poweron

clone:
disable: true

steps:
- name: drone-agents-poweron
image: walkero/hcloud:1.30
environment:
HCLOUD_TOKEN:
from_secret: HCLOUD_TOKEN
commands:
- hcloud server poweron drone-agents

trigger:
branch:
include:
- master
- develop
event:
include:
- push
- pull_request
- tag

---

kind: pipeline
type: docker
name: compile-tests
Expand Down Expand Up @@ -32,6 +61,38 @@ steps:
- compile-m68k
- compile-os4
- compile-mos
- name: Prepare test release
image: walkero/lha-on-docker:latest
environment:
OS4DEPOT_PASSPHRASE:
from_secret: OS4DEPOT_PASSPHRASE
commands:
- mkdir test-release
- ls -la ./
- cp iGame--$(date +'%Y%m%d').lha ./test-release/iGame-$(date +'%Y%m%d%H%M').lha
- sed -i "s/VERSION_TAG/nightly-$(date +'%Y%m%d%H%M')/" ./aminet.readme
- sed -i "s/VERSION_TAG/nightly-$(date +'%Y%m%d%H%M')/" ./os4depot.readme
- sed -i "s/OS4DEPOT_PASSPHRASE/$OS4DEPOT_PASSPHRASE/" ./os4depot.readme
- cp ./os4depot.readme ./test-release/os4depot.readme
- cp ./aminet.readme ./test-release/aminet.readme
- ls -la ./test-release
depends_on:
- create-release-lha
# - name: Upload to TEST FTP
# image: cschlosser/drone-ftps
# environment:
# FTP_USERNAME:
# from_secret: TESTFTP_USERNAME
# FTP_PASSWORD:
# from_secret: TESTFTP_PASSWORD
# PLUGIN_HOSTNAME: mediavault.amiga-projects.net:21
# PLUGIN_SRC_DIR: /test-release
# PLUGIN_DEST_DIR: ./web/betas
# PLUGIN_SECURE: "false"
# PLUGIN_VERIFY: "false"
# PLUGIN_CLEAN_DIR: "false"
# depends_on:
# - Prepare test release

trigger:
branch:
Expand All @@ -43,6 +104,12 @@ trigger:
- push
- pull_request

depends_on:
- drone-agents-poweron

node:
agents: builders

---

kind: pipeline
Expand Down Expand Up @@ -71,26 +138,116 @@ steps:
image: walkero/docker4amigavbcc:latest-mos
commands:
- make -f Makefile.docker CPU=MOS
- name: create-release-lha
- name: Create release
image: walkero/docker4amigavbcc:latest-m68k
commands:
- make -f Makefile.docker release
depends_on:
- compile-m68k
- compile-os4
- compile-mos
- name: deploy-all-binary
- name: deploy-on-repo
image: plugins/github-release
settings:
api_key:
from_secret: GITHUB_RELEASE_API_KEY
files:
- "iGame-*.lha"
api_key:
from_secret: GITHUB_RELEASE_API_KEY
files:
- "iGame-*.lha"
title: "iGame release ${DRONE_TAG}"
depends_on:
- create-release-lha
- Create release
- name: Prepare Aminet release
image: walkero/lha-on-docker:latest
commands:
- mkdir aminet-release
- cp iGame-${DRONE_TAG}-$(date +'%Y%m%d').lha ./aminet-release/iGame.lha
- sed -i "s/VERSION_TAG/${DRONE_TAG}/" ./aminet.readme
- cp ./aminet.readme ./aminet-release/iGame.readme
depends_on:
- Create release
- name: Upload to Aminet
image: cschlosser/drone-ftps
environment:
FTP_USERNAME: "anonymous"
FTP_PASSWORD: "[email protected]"
PLUGIN_HOSTNAME: main.aminet.net:21
PLUGIN_SRC_DIR: /aminet-release
PLUGIN_DEST_DIR: ./new
PLUGIN_SECURE: "false"
PLUGIN_VERIFY: "false"
PLUGIN_CHMOD: "false"
depends_on:
- Prepare Aminet release
- name: Prepare OS4Depot release
image: walkero/lha-on-docker:latest
environment:
OS4DEPOT_PASSPHRASE:
from_secret: OS4DEPOT_PASSPHRASE
commands:
- mkdir os4depot-release
- cp iGame-${DRONE_TAG}-$(date +'%Y%m%d').lha ./os4depot-release/iGame.lha
- sed -i "s/VERSION_TAG/${DRONE_TAG}/" ./os4depot.readme
- sed -i "s/OS4DEPOT_PASSPHRASE/$OS4DEPOT_PASSPHRASE/" ./os4depot.readme
- cp ./os4depot.readme ./os4depot-release/iGame_lha.readme
depends_on:
- Create release
- name: Upload to OS4Depot
image: cschlosser/drone-ftps
environment:
FTP_USERNAME: "ftp"
FTP_PASSWORD: ""
PLUGIN_HOSTNAME: os4depot.net:21
PLUGIN_SRC_DIR: /os4depot-release
PLUGIN_DEST_DIR: ./upload
PLUGIN_SECURE: "false"
PLUGIN_VERIFY: "false"
PLUGIN_CHMOD: "false"
depends_on:
- Prepare OS4Depot release

trigger:
event:
include:
- tag

depends_on:
- drone-agents-poweron

node:
agents: builders

---

kind: pipeline
type: docker
name: drone-agents-poweroff

clone:
disable: true

steps:
- name: drone-agents-poweroff
image: walkero/hcloud:1.30
environment:
HCLOUD_TOKEN:
from_secret: HCLOUD_TOKEN
commands:
- curl -sw "\n" "http://10.0.0.2:5000/container/count/drone-" | while read var1; do if [ $var1 -eq 1 ]; then hcloud server poweroff drone-agents; fi ; done

depends_on:
- compile-tests
- compile-release-bytag

trigger:
status:
- failure
- success
branch:
include:
- master
- develop
event:
include:
- push
- pull_request
- tag
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## iGame 2.2.0 - [future]
## iGame VERSION_TAG - [RELEASE_DATE]
### Added
- Added automatic release to Aminet and OS4Depot through the CI/CD whenever a new release tag is created at the repo

### Changed
- Removed completely the Tooltypes. Now iGame defaults to the optimal settings and uses only the settings file to change its behaviour.
Expand Down
8 changes: 8 additions & 0 deletions Makefile.docker
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ clean:
rm iGame iGame.* src/funcs*.o src/iGameGUI*.o src/iGameMain*.o src/strfuncs*.o src/iGame_cat*.o $(catalog_files)

release: $(catalog_files)
ifneq ($(origin DRONE_TAG),undefined)
sed -i "s/VERSION_TAG/$(DRONE_TAG)/" ./required_files/iGame.guide
sed -i "s/RELEASE_DATE/$(shell date "+%d.%m.%Y")/" ./required_files/iGame.guide
endif
cp required_files iGame-$(DRONE_TAG) -r
cp alt_icons iGame-$(DRONE_TAG)/icons -r
cp iGame-$(DRONE_TAG)/igame_drawer_3.0.info iGame-$(DRONE_TAG).info
Expand All @@ -149,6 +153,10 @@ release: $(catalog_files)
cp catalogs/iGame.cd iGame-$(DRONE_TAG)/catalogs/
cd iGame-$(DRONE_TAG) && mkdir $(catalog_dirs)
for c in $(catalog_files); do cp $$c iGame-$(DRONE_TAG)/$$(dirname $$c)/; done
ifneq ($(origin DRONE_TAG),undefined)
sed -i "s/VERSION_TAG/$(DRONE_TAG)/" ./CHANGELOG.md
sed -i "s/RELEASE_DATE/$(shell date "+%Y-%m-%d")/" ./CHANGELOG.md
endif
cp CHANGELOG.md iGame-$(DRONE_TAG)/
if [ -f "iGame.000" ]; then cp iGame.000 iGame-$(DRONE_TAG)/iGame; fi
if [ -f "iGame.030" ]; then cp iGame.030 iGame-$(DRONE_TAG)/; fi
Expand Down
2 changes: 1 addition & 1 deletion aminet.readme
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Short: Frontend for WHDLoad
Uploader: [email protected] (George Sokianos)
Author: [email protected] (Emmanuel Vasilakis)
Type: util/misc
Version: 2.1
Version: VERSION_TAG
Architecture: m68k-amigaos >= 2.04; ppc-amigaos; ppc-morphos
Distribution: Aminet
Replaces: util/misc/iGame.lha
Expand Down
2 changes: 1 addition & 1 deletion os4depot.readme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: iGame
description: Frontend for WHDLoad
version: 2.1
version: VERSION_TAG
author: Emmanuel Vasilakis and contributors
submitter: George Sokianos
email: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion required_files/iGame.guide
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@DATABASE iGame.guide
@$VER: iGame.guide 2.2 (04.11.2022)
@$VER: iGame.guide VERSION_TAG (RELEASE_DATE)
@INDEX "Index"
@wordwrap

Expand Down

0 comments on commit cfe4642

Please sign in to comment.