Skip to content

Commit

Permalink
feat: Import the new versioning system
Browse files Browse the repository at this point in the history
  • Loading branch information
Force67 committed Nov 14, 2021
1 parent dfa1b79 commit 5a23cca
Show file tree
Hide file tree
Showing 8 changed files with 4,358 additions and 12 deletions.
10 changes: 10 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

commit_regex='^(?<type>build|chore|ci|docs|feat|fix|tweak|perf|refactor|revert|style|test|¯\\_\(ツ\)_\/¯|\[skip-ci\])(?<scope>\(\w+\)?((?=:\s)|(?=!:\s)))?(?<breaking>!)?(?<subject>:\s.*)?|^(?<merge>Merge \w+)'

error_msg='.githooks/commit-msg: Aborting commit, try again with a valid message. The regexp checks for: a conventional commit message subject (to be parsed into changelogs, see https://www.conventionalcommits.org/en/v1.0.0)'

if ! grep -iqE "${commit_regex}" "$1"; then
echo "${error_msg}" >&2
exit 1
fi
43 changes: 32 additions & 11 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
push:
branches:
- master

- bluedove
- prerel
jobs:
build:
strategy:
Expand All @@ -24,38 +25,58 @@ jobs:
run: |
git submodule sync --recursive
git submodule update --init --force --recursive --depth=1
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1

#- name: Yeet xmake-repo
# run: |
# xmake.exe repo -g -a tilted https://github.com/tiltedphoques/xmake-repo.git
# Install node
- name: Setup nodejs
uses: actions/setup-node@v2
with:
cache: npm
node-version: 16

# Update xmake repository (in order to have the file that will be cached)
- name: Update xmake repository
run: xmake.exe repo --update

# Cache xmake dependencies
- uses: actions/cache@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: C:\Users\runneradmin\AppData\Local\.xmake\packages
key: ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.mode }}-${{ hashFiles('xmake.lua') }}-${{ hashFiles('C:\Users\runneradmin\AppData\Local\.xmake\xmake.conf') }}-${{ hashFiles('C:\Users\runneradmin\AppData\Local\.xmake\repositories\**') }}

# Setup compilation mode and install project dependencies
- name: Prepare npm
run: npm install @semantic-release/github @semantic-release/exec conventional-changelog-conventionalcommits

# Delete old releases
- name: Remove old releases
uses: dev-drprasad/delete-older-releases@v0.2.0
with:
keep_latest: 1
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

# Release version
- name: Release version
run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Configure xmake and install dependencies
run: xmake.exe config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --yes --vs_sdkver=10.0.19041.0 -vD

# Build the game
- name: Build
- name: Build with xmake
run: xmake.exe

# Create install
- name: Install
- name: Bundle package
run: xmake.exe install -o packaged

# Upload artifacts
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }}
path: packaged/bin/**
path: packaged/bin/**
1 change: 1 addition & 0 deletions .gitmessage/conventional_commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat:
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
url = https://github.com/TiltedPhoques/TiltedScript
[submodule "Libraries/cpp-httplib"]
path = Libraries/cpp-httplib
url = https://github.com/yhirose/cpp-httplib.git
url = https://github.com/yhirose/cpp-httplib.git
37 changes: 37 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"branches": ["master", "bluedove", "prerel"],
"plugins": [
["@semantic-release/commit-analyzer", {
"preset": "angular",
"releaseRules": [
{"type": "tweak", "release": "patch"},
{"scope": "no-release", "release": false}
]
}],
["@semantic-release/release-notes-generator", {
"writerOpts": {
"groupBy": "type",
"commitGroupSort": [
"feat", "tweak", "perf", "fix"],
"headingLevel": "2",
"sectionSymbol": "*"
},
"types": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "perf", "section": "Performance Improvements"},
{"type": "tweak", "section": "Tweaks"},
{"type": "WIP", "section": "WIP"}
]
}],
"@semantic-release/changelog",
["@semantic-release/npm", {
"npmPublish": false
}],
["@semantic-release/git", {
"assets": ["CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
],
"preset": "angular"
}
Empty file added CHANGELOG.md
Empty file.
Loading

0 comments on commit 5a23cca

Please sign in to comment.