initial working version

This commit is contained in:
2026-06-06 19:10:03 +02:00
parent dc16766313
commit c2f97dbe93
4 changed files with 149 additions and 149 deletions
+128 -131
View File
@@ -1,131 +1,128 @@
name: Publish Release name: Publish Release
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
release_candidate: release_candidate:
description: 'Is this a release candidate?' description: 'Is this a release candidate?'
required: true required: true
default: true default: true
type: boolean type: boolean
change_size: change_size:
type: choice type: choice
description: Version Bump description: Version Bump
options: options:
- patch - patch
- minor - minor
- major - major
default: patch default: patch
branches: jobs:
- main build:
- automation runs-on: ubuntu-latest
jobs: steps:
build: - name: Checkout repository
runs-on: ubuntu-latest uses: actions/checkout@v4
with:
steps: fetch-depth: 0 # Fetch all history for all branches and tags
- name: Checkout repository
uses: actions/checkout@v4 - name: Compile Spearhead
with: uses: dutchie031/DcsMissionScriptingTools/github-action@actions/v1
fetch-depth: 0 # Fetch all history for all branches and tags with:
source-root: ./src
- name: Run SpearheadCompile output-file: ./output/spearhead.lua
run: |
mkdir -p ./output - name: Calculate Tag
python3 SpearheadCompile.py . ./output/spearhead.lua id: calculate_tag
run: |
- name: Calculate Tag # Get latest tag with 'v' prefix
id: calculate_tag latest_tag=$(git tag --sort=-v:refname | grep -E '^v' | head -n 1)
run: | if [ -z "$latest_tag" ]; then
# Get latest tag with 'v' prefix latest_tag="v0.0.0"
latest_tag=$(git tag --sort=-v:refname | grep -E '^v' | head -n 1) fi
if [ -z "$latest_tag" ]; then echo "Latest tag: $latest_tag"
latest_tag="v0.0.0" # Remove 'v' prefix for version parsing
fi version=${latest_tag#v}
echo "Latest tag: $latest_tag" IFS='.' read -r major minor patch <<< "$version"
# Remove 'v' prefix for version parsing bump="${{ inputs.change_size }}"
version=${latest_tag#v} if [ "$bump" = "major" ]; then
IFS='.' read -r major minor patch <<< "$version" major=$((major+1))
bump="${{ inputs.change_size }}" minor=0
if [ "$bump" = "major" ]; then patch=0
major=$((major+1)) elif [ "$bump" = "minor" ]; then
minor=0 minor=$((minor+1))
patch=0 patch=0
elif [ "$bump" = "minor" ]; then else
minor=$((minor+1)) patch=$((patch+1))
patch=0 fi
else new_tag="v${major}.${minor}.${patch}"
patch=$((patch+1)) if [ "${{ inputs.release_candidate }}" = "true" ]; then
fi new_tag="$new_tag-rc"
new_tag="v${major}.${minor}.${patch}" fi
if [ "${{ inputs.release_candidate }}" = "true" ]; then echo "New tag: $new_tag"
new_tag="$new_tag-rc" echo "new_tag=$new_tag" >> "$GITHUB_OUTPUT"
fi
echo "New tag: $new_tag" - name: Check for existing tag
echo "new_tag=$new_tag" >> "$GITHUB_OUTPUT" id: check_tag
run: |
- name: Check for existing tag if git tag | grep -q "^${{ steps.calculate_tag.outputs.new_tag }}$"; then
id: check_tag echo "Tag already exists. Exiting."
run: | exit 1
if git tag | grep -q "^${{ steps.calculate_tag.outputs.new_tag }}$"; then fi
echo "Tag already exists. Exiting."
exit 1 - name: Generate Release Notes
fi id: generate_release_notes
run: |
- name: Generate Release Notes if [ "${{ inputs.release_candidate }}" != "true" ]; then
id: generate_release_notes git log $(git describe --tags --abbrev=0 $(git tag --sort=-v:refname | grep -v '-rc' | head -n 1))..HEAD --pretty=format:'- %s%n %b' > release_notes.txt
run: | else
if [ "${{ inputs.release_candidate }}" != "true" ]; then git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:'- %s%n %b' > release_notes.txt
git log $(git describe --tags --abbrev=0 $(git tag --sort=-v:refname | grep -v '-rc' | head -n 1))..HEAD --pretty=format:'- %s%n %b' > release_notes.txt fi
else awk -i inplace '!seen[$0]++' release_notes.txt
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:'- %s%n %b' > release_notes.txt cat release_notes.txt
fi shell: bash
awk -i inplace '!seen[$0]++' release_notes.txt
cat release_notes.txt - name: Apply Tag to Current Commit
shell: bash run: |
git config user.name "github-actions"
- name: Apply Tag to Current Commit git config user.email "github-actions@github.com"
run: | git tag ${{ steps.calculate_tag.outputs.new_tag }}
git config user.name "github-actions" git push origin ${{ steps.calculate_tag.outputs.new_tag }}
git config user.email "github-actions@github.com"
git tag ${{ steps.calculate_tag.outputs.new_tag }} - name: Copy Release to Versioned File
git push origin ${{ steps.calculate_tag.outputs.new_tag }} run: |
cp ./output/spearhead.lua ./output/spearhead.${{ steps.calculate_tag.outputs.new_tag }}.lua
- name: Copy Release to Versioned File echo "Versioned file created: spearhead.${{ steps.calculate_tag.outputs.new_tag }}.lua"
run: |
cp ./output/spearhead.lua ./output/spearhead.${{ steps.calculate_tag.outputs.new_tag }}.lua - name: Create GitHub Release
echo "Versioned file created: spearhead.${{ steps.calculate_tag.outputs.new_tag }}.lua" uses: actions/create-release@v1
id: create_release
- name: Create GitHub Release with:
uses: actions/create-release@v1 tag_name: ${{ steps.calculate_tag.outputs.new_tag }}
id: create_release release_name: Release ${{ steps.calculate_tag.outputs.new_tag }}
with: draft: true
tag_name: ${{ steps.calculate_tag.outputs.new_tag }} body_path: release_notes.txt
release_name: Release ${{ steps.calculate_tag.outputs.new_tag }} prerelease: ${{ inputs.release_candidate }}
draft: true env:
body_path: release_notes.txt GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ inputs.release_candidate }}
env: - name: Upload Spearhead.lua Asset
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} uses: actions/upload-release-asset@v1
env:
- name: Upload Spearhead.lua Asset GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/upload-release-asset@v1 with:
env: upload_url: ${{ steps.create_release.outputs.upload_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} asset_path: ./output/spearhead.lua
with: asset_name: spearhead.lua
upload_url: ${{ steps.create_release.outputs.upload_url }} asset_content_type: application/octet-stream
asset_path: ./output/spearhead.lua
asset_name: spearhead.lua - name: Upload Spearhead.lua Asset
asset_content_type: application/octet-stream uses: actions/upload-release-asset@v1
env:
- name: Upload Spearhead.lua Asset GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/upload-release-asset@v1 with:
env: upload_url: ${{ steps.create_release.outputs.upload_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} asset_path: ./output/spearhead.${{steps.calculate_tag.outputs.new_tag}}.lua
with: asset_name: spearhead.${{steps.calculate_tag.outputs.new_tag}}.lua
upload_url: ${{ steps.create_release.outputs.upload_url }} asset_content_type: application/octet-stream
asset_path: ./output/spearhead.${{steps.calculate_tag.outputs.new_tag}}.lua
asset_name: spearhead.${{steps.calculate_tag.outputs.new_tag}}.lua
asset_content_type: application/octet-stream
Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

+19 -14
View File
@@ -32,23 +32,28 @@
<div class="content-wrapper"> <div class="content-wrapper">
<h1 id="welcome">Welcome to Spearhead!</h1> <h1 id="welcome">Welcome to Spearhead!</h1>
<p>Welcome to the story teller friendly mission framework in DCS (at least, that's what we hope to create).</p>
<p>Together with mission editors we've tried to build a framework that makes creating multiplayer missions as easy as possible.
With the help of naming conventions, trigger zones, pre-configured logic and custom configuration items, it gives a huge amount of versatility.
we're trying to strike a balance between no-code and low-code with the possibility to hook into it for the hard core scripters (like ourselves).
<note-box type="info">
<b>For the scripters</b>: If you yourself are a scripter, and you're missing interfaces, please reach out to us! We want to make sure that the framework is as easy to use for scripters as it is for non-scripters, and we can't do that without your help!
</note-box>
</p>
<p>
Whether this is your first mission or your hundredth, we hope Spearhead will make your life easier.
</p>
<download-spearhead></download-spearhead>
<p>Welcome to the story teller friendly mission framework in DCS (at least, that's what we hope to create).</p>
<p>Together with mission editors we've tried to build a framework that
makes creating multiplayer missions as easy as possible.
With the help of naming conventions, trigger zones, pre-configured
logic and custom configuration items, it gives a huge amount of versatility.
we're trying to strike a balance between no-code and low-code with the possibility to hook into it for
the hard core scripters.
</p>
<p>
Whether this is your first mission or your hundredth, we hope Spearhead will make your life easier.
</p>
<download-spearhead></download-spearhead>
</div> </div>
</div> </div>
</main> </main>
<footer> <footer>
+2 -4
View File
@@ -37,10 +37,8 @@
Even though, at the time of writing this, I've written every single line of code myself, I could not have done it without the help of these members.<br> Even though, at the time of writing this, I've written every single line of code myself, I could not have done it without the help of these members.<br>
Therefore it's something WE created. Therefore it's something WE created.
Our goal was very simple, make it possible to make big dynamic missions, without having to either give away all controll or having to get knee deep into scripting. <br> Our goal was very simple, make it possible to make big dynamic missions, without having to either give away all control or having to get knee deep into scripting. <br>
We struck a balance. We struck a balance.
</p> </p>