Skip to content

Commit

Permalink
Automate builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Cho committed Jan 31, 2021
1 parent 1f9a22c commit 1483fb2
Show file tree
Hide file tree
Showing 15 changed files with 147 additions and 26 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Build

on:
- push

jobs:
main:
runs-on: ubuntu-latest
container: jamieleecho/coco-dev:0.31
steps:
- uses: actions/checkout@v1
- name: Build
run: ./build-github
22 changes: 22 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Bump and Tag Version

on: [workflow_dispatch]

jobs:
bump:
if: "!contains(github.event.head_commit.author.name, 'version-bumper')"
runs-on: ubuntu-latest

steps:
# Checkout action is required
- uses: actions/checkout@v2
with:
token: ${{ secrets.ADMIN_TOKEN }}
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: Bump Versions
uses: michmich112/version-bumper@master
with:
options-file: './bump-info.json'
github-token: ${{ secrets.ADMIN_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Make a New Release

on:
push:
tags:
- '*'

jobs:
main:
runs-on: ubuntu-latest
container: jamieleecho/coco-dev:0.31
steps:
- uses: actions/checkout@v1
- name: Build
run: ./build-github
- name: Get the tag
run: |
echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "REPO_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "./*/*.dsk"
allowUpdates: true
draft: true
name: "${{ format('{0} {1}', env.REPO_NAME, env.RELEASE_TAG) }}"
65 changes: 48 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,54 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
*.c10

# Compiler Detrius
*.asm
*.lst
*.hex
*.bin
*.lst
*.asm
*.i
cfg/*
*.dsk
!Ancient/*
*~
#*
.#*
!Balloon/Balloonr.bin
!Balloon/Ballon.bin
!Balloon/Scene1.bin
!Rick/Pix.bin
!Rick/Guy.bin
.*.swp
.DS_Store
*.o
*.i
*.s
*.map
*.link
.bash*

# Editor stuff
*.swp
*~

# Mac Junk
.DS_Store

# Executables
minilisp
2 changes: 1 addition & 1 deletion Balloon/build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh

export DOCKER_IMAGE=jamieleecho/coco-dev:0.12
export DOCKER_IMAGE=jamieleecho/coco-dev:0.31
docker run --rm --volume `pwd`/..:/home/coco-dev --workdir /home/coco-dev/Balloon $DOCKER_IMAGE make "$@"
2 changes: 1 addition & 1 deletion Bouncy/build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh

export DOCKER_IMAGE=jamieleecho/coco-dev:0.12
export DOCKER_IMAGE=jamieleecho/coco-dev:0.31
docker run --rm --volume `pwd`:/home/coco-dev --workdir /home/coco-dev $DOCKER_IMAGE make "$@"
2 changes: 1 addition & 1 deletion Bouncy/render1.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct BOUNCY_LEVEL level_test = {
0,12, //reqired keys, keys present
0, //max time
0, //best score
(byte *)NULL,
NULL,
testData
};

Expand Down
2 changes: 1 addition & 1 deletion Demo/build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh

export DOCKER_IMAGE=jamieleecho/coco-dev:0.12
export DOCKER_IMAGE=jamieleecho/coco-dev:0.31
docker run --rm --volume `pwd`:/home/coco-dev --workdir /home/coco-dev $DOCKER_IMAGE make "$@"
2 changes: 1 addition & 1 deletion Primes/build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh

export DOCKER_IMAGE=jamieleecho/coco-dev:0.12
export DOCKER_IMAGE=jamieleecho/coco-dev:0.31
docker run --rm --volume `pwd`:/home/coco-dev --workdir /home/coco-dev $DOCKER_IMAGE make "$@"
2 changes: 1 addition & 1 deletion Rick/build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh

export DOCKER_IMAGE=jamieleecho/coco-dev:0.12
export DOCKER_IMAGE=jamieleecho/coco-dev:0.31
docker run --rm --volume `pwd`:/home/coco-dev --workdir /home/coco-dev $DOCKER_IMAGE make "$@"
6 changes: 4 additions & 2 deletions Splinter/Splinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
back around 1989 or so.
*/

#define VERSION "Splinter 1.0"

#include <coco.h>
#include <cmoc.h>

Expand Down Expand Up @@ -368,9 +370,9 @@ void SplinterShowTitleScreen() {
// Draw the title
unsigned int x = 0, y = 0;
BlitterDrawText2(FontDataFontIndex, FontDataFontData,
15, x + 120, y + 11, 2, "Splinter 1");
15, x + 112, y + 11, 2, VERSION);
BlitterDrawText2(FontDataFontIndex, FontDataFontData,
2, x + 119, y + 10, 2, "Splinter 1");
2, x + 113, y + 10, 2, VERSION);

y = 2;
BlitterFillRectangle(60, y + 25, 200, 131, f);
Expand Down
2 changes: 1 addition & 1 deletion Splinter/build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh

export DOCKER_IMAGE=jamieleecho/coco-dev:0.12
export DOCKER_IMAGE=jamieleecho/coco-dev:0.31
docker run --rm --volume `pwd`:/home/coco-dev --workdir /home/coco-dev $DOCKER_IMAGE make "$@"
8 changes: 8 additions & 0 deletions build-github
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh

(cd Balloon && make "$@")
(cd Bouncy && make "$@")
(cd Demo && make "$@")
(cd Primes && make "$@")
(cd Rick && make "$@")
(cd Splinter && make "$@")
15 changes: 15 additions & 0 deletions bump-info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"scheme": "custom",
"schemeDefinition": "major.minor[.build][->patch]",
"versionFile": "./package.json",
"files": [{
"path": "Splinter/Splinter.c",
"line": 11
}],
"rules": [{
"trigger": "manual",
"bump": "minor",
"branch": "main",
"reset": "build"
}]
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "minilisp",
"version": "1"
}

0 comments on commit 1483fb2

Please sign in to comment.