diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ddb2e44..26df86d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,131 +1,128 @@ -name: Publish Release - -on: - workflow_dispatch: - inputs: - release_candidate: - description: 'Is this a release candidate?' - required: true - default: true - type: boolean - change_size: - type: choice - description: Version Bump - options: - - patch - - minor - - major - default: patch - branches: - - main - - automation - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history for all branches and tags - - - name: Run SpearheadCompile - run: | - mkdir -p ./output - python3 SpearheadCompile.py . ./output/spearhead.lua - - - name: Calculate Tag - id: calculate_tag - run: | - # Get latest tag with 'v' prefix - latest_tag=$(git tag --sort=-v:refname | grep -E '^v' | head -n 1) - if [ -z "$latest_tag" ]; then - latest_tag="v0.0.0" - fi - echo "Latest tag: $latest_tag" - # Remove 'v' prefix for version parsing - version=${latest_tag#v} - IFS='.' read -r major minor patch <<< "$version" - bump="${{ inputs.change_size }}" - if [ "$bump" = "major" ]; then - major=$((major+1)) - minor=0 - patch=0 - elif [ "$bump" = "minor" ]; then - minor=$((minor+1)) - patch=0 - else - patch=$((patch+1)) - fi - new_tag="v${major}.${minor}.${patch}" - if [ "${{ inputs.release_candidate }}" = "true" ]; then - new_tag="$new_tag-rc" - fi - echo "New tag: $new_tag" - echo "new_tag=$new_tag" >> "$GITHUB_OUTPUT" - - - name: Check for existing tag - id: check_tag - run: | - if git tag | grep -q "^${{ steps.calculate_tag.outputs.new_tag }}$"; then - echo "Tag already exists. Exiting." - exit 1 - fi - - - name: Generate Release Notes - id: generate_release_notes - run: | - if [ "${{ inputs.release_candidate }}" != "true" ]; then - 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 - else - git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:'- %s%n %b' > release_notes.txt - fi - awk -i inplace '!seen[$0]++' release_notes.txt - cat release_notes.txt - shell: bash - - - name: Apply Tag to Current Commit - run: | - git config user.name "github-actions" - git config user.email "github-actions@github.com" - git tag ${{ steps.calculate_tag.outputs.new_tag }} - git push origin ${{ steps.calculate_tag.outputs.new_tag }} - - - name: Copy Release to Versioned File - run: | - cp ./output/spearhead.lua ./output/spearhead.${{ steps.calculate_tag.outputs.new_tag }}.lua - echo "Versioned file created: spearhead.${{ steps.calculate_tag.outputs.new_tag }}.lua" - - - name: Create GitHub Release - uses: actions/create-release@v1 - id: create_release - with: - tag_name: ${{ steps.calculate_tag.outputs.new_tag }} - release_name: Release ${{ steps.calculate_tag.outputs.new_tag }} - draft: true - body_path: release_notes.txt - prerelease: ${{ inputs.release_candidate }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload Spearhead.lua Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./output/spearhead.lua - asset_name: spearhead.lua - asset_content_type: application/octet-stream - - - name: Upload Spearhead.lua Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - 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 - +name: Publish Release + +on: + workflow_dispatch: + inputs: + release_candidate: + description: 'Is this a release candidate?' + required: true + default: true + type: boolean + change_size: + type: choice + description: Version Bump + options: + - patch + - minor + - major + default: patch +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all branches and tags + + - name: Compile Spearhead + uses: dutchie031/DcsMissionScriptingTools/github-action@actions/v1 + with: + source-root: ./src + output-file: ./output/spearhead.lua + + - name: Calculate Tag + id: calculate_tag + run: | + # Get latest tag with 'v' prefix + latest_tag=$(git tag --sort=-v:refname | grep -E '^v' | head -n 1) + if [ -z "$latest_tag" ]; then + latest_tag="v0.0.0" + fi + echo "Latest tag: $latest_tag" + # Remove 'v' prefix for version parsing + version=${latest_tag#v} + IFS='.' read -r major minor patch <<< "$version" + bump="${{ inputs.change_size }}" + if [ "$bump" = "major" ]; then + major=$((major+1)) + minor=0 + patch=0 + elif [ "$bump" = "minor" ]; then + minor=$((minor+1)) + patch=0 + else + patch=$((patch+1)) + fi + new_tag="v${major}.${minor}.${patch}" + if [ "${{ inputs.release_candidate }}" = "true" ]; then + new_tag="$new_tag-rc" + fi + echo "New tag: $new_tag" + echo "new_tag=$new_tag" >> "$GITHUB_OUTPUT" + + - name: Check for existing tag + id: check_tag + run: | + if git tag | grep -q "^${{ steps.calculate_tag.outputs.new_tag }}$"; then + echo "Tag already exists. Exiting." + exit 1 + fi + + - name: Generate Release Notes + id: generate_release_notes + run: | + if [ "${{ inputs.release_candidate }}" != "true" ]; then + 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 + else + git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:'- %s%n %b' > release_notes.txt + fi + awk -i inplace '!seen[$0]++' release_notes.txt + cat release_notes.txt + shell: bash + + - name: Apply Tag to Current Commit + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git tag ${{ steps.calculate_tag.outputs.new_tag }} + git push origin ${{ steps.calculate_tag.outputs.new_tag }} + + - name: Copy Release to Versioned File + run: | + cp ./output/spearhead.lua ./output/spearhead.${{ steps.calculate_tag.outputs.new_tag }}.lua + echo "Versioned file created: spearhead.${{ steps.calculate_tag.outputs.new_tag }}.lua" + + - name: Create GitHub Release + uses: actions/create-release@v1 + id: create_release + with: + tag_name: ${{ steps.calculate_tag.outputs.new_tag }} + release_name: Release ${{ steps.calculate_tag.outputs.new_tag }} + draft: true + body_path: release_notes.txt + prerelease: ${{ inputs.release_candidate }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Spearhead.lua Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./output/spearhead.lua + asset_name: spearhead.lua + asset_content_type: application/octet-stream + + - name: Upload Spearhead.lua Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + 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 + diff --git a/_docs/img/first-start/1.png b/_docs/img/first-start/1.png new file mode 100644 index 0000000..cb3ff69 Binary files /dev/null and b/_docs/img/first-start/1.png differ diff --git a/_docs/index.html b/_docs/index.html index 3ba81de..511d204 100644 --- a/_docs/index.html +++ b/_docs/index.html @@ -32,23 +32,28 @@
Welcome to the story teller friendly mission framework in DCS (at least, that's what we hope to create).
+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).
+
+
+ Whether this is your first mission or your hundredth, we hope Spearhead will make your life easier. +
+ +Welcome to the story teller friendly mission framework in DCS (at least, that's what we hope to create).
-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. -
-- Whether this is your first mission or your hundredth, we hope Spearhead will make your life easier. -
-