Skip to content

Fix panic when start and end area are the same #172

Fix panic when start and end area are the same

Fix panic when start and end area are the same #172

name: Build, test, release pre-alpha
on: [ push, pull_request ]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # keep testing other platforms if one fails
matrix:
os: [ ubuntu-latest, windows-latest ]
name: Build and test on ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Ensure .planning is correct
run: ./.build/check-planning.sh "$GITHUB_REF_SLUG"
shell: bash
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Setup Rust cache
uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true
- name: Build and run tests
run: ./.build/run-tests.sh
shell: bash
- name: Build and run headless game
run: ./.build/run-headless.sh
shell: bash
build_release:
name: Building pre-alpha release for ${{ matrix.platform }}
needs: create_release
if: needs.build_and_test.result != 'failure' && !contains(github.event.head_commit.message, 'skip-ci-release') && github.ref == 'refs/heads/develop'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
include:
- os: ubuntu-latest
suffix: ""
platform: "linux"
zip_suffix: "tar.gz"
content_type: "application/gzip"
- os: windows-latest
suffix: ".exe"
platform: "windows"
zip_suffix: "zip"
content_type: "application/zip"
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Setup Rust cache
uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true
- name: Build release
id: build-release
run: |
TARGET=$(./.build/build-release.sh "${{ matrix.suffix }}" "${{ matrix.platform }}")
echo "::set-output name=TARGET::$TARGET"
shell: bash
- name: Upload release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ steps.build-release.outputs.TARGET }}
asset_name: nn-pre-alpha-${{ github.run_number}}-${{ matrix.platform }}.${{ matrix.zip_suffix }}
asset_content_type: ${{ matrix.content_type }}
create_release:
name: Create pre-alpha release
needs: build_and_test
if: needs.build_and_test.result != 'failure' && !contains(github.event.head_commit.message, 'skip-ci-release') && github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.do_create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Create pre-alpha release
id: do_create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "pre-alpha-${{ github.run_number }}"
release_name: "Pre-alpha (build ${{ github.run_number }})"
prerelease: true
draft: true # draft by default to be manually published if it's exciting
body: |
*This pre-alpha "release" is really just the latest build of the develop branch. Stability, playability, functionality and enjoyment are not guaranteed in the slightest!*
See the top of the [README](https://github.com/DomWilliams0/name-needed/blob/develop/README.md) for screenshots of the latest changes. Maybe the commits in this release will be published here eventually.
Thank you for checking out the project!