minedmap 2.5.0 #244
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'MinedMap' | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- 'main' | |
workflow_dispatch: {} | |
env: | |
RUSTFLAGS: -Dwarnings | |
RUSTDOCFLAGS: -Dwarnings | |
jobs: | |
viewer: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: 'Checkout' | |
uses: 'actions/checkout@v4' | |
- name: 'Get version' | |
id: 'tag' | |
run: | | |
set -o pipefail | |
git fetch --prune --unshallow --tags -f | |
echo "tag=$(git describe --abbrev=7 --match='v*' | sed 's/^v//')" >> $GITHUB_OUTPUT | |
- name: 'Install' | |
run: | | |
pkgdir='build/pkg/MinedMap-${{ steps.tag.outputs.tag }}-viewer' | |
mkdir -p "$pkgdir" | |
cp -r viewer/* "$pkgdir"/ | |
rm "$pkgdir"/Dockerfile | |
- name: 'Archive' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'MinedMap-${{ steps.tag.outputs.tag }}-viewer' | |
path: 'build/pkg' | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: '1.85' | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: '1.85' | |
components: clippy | |
- uses: swatinem/rust-cache@v2 | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --workspace --tests --examples | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: '1.85' | |
components: rust-docs | |
- uses: swatinem/rust-cache@v2 | |
- run: cargo doc --workspace --no-deps --document-private-items | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: '1.85' | |
- uses: swatinem/rust-cache@v2 | |
- run: cargo test --workspace | |
- run: cargo test --workspace --no-default-features | |
- run: cargo test --workspace --examples --bins | |
- run: cargo test --workspace --no-default-features --examples --bins | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: 'macos-13' | |
target: 'aarch64-apple-darwin' | |
- os: 'macos-13' | |
target: 'x86_64-apple-darwin' | |
- os: 'windows-2019' | |
target: 'x86_64-pc-windows-msvc' | |
ext: '.exe' | |
- os: 'windows-2019' | |
target: 'i686-pc-windows-msvc' | |
ext: '.exe' | |
- os: 'ubuntu-22.04' | |
target: 'x86_64-unknown-linux-gnu' | |
steps: | |
- name: 'Checkout' | |
uses: 'actions/checkout@v4' | |
- name: 'Get version' | |
id: 'tag' | |
shell: 'bash' | |
run: | | |
set -o pipefail | |
git fetch --prune --unshallow --tags -f | |
echo "tag=$(git describe --abbrev=7 --match='v*' | sed 's/^v//')" >> $GITHUB_OUTPUT | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: '1.85' | |
targets: '${{ matrix.target }}' | |
- uses: swatinem/rust-cache@v2 | |
with: | |
key: '${{ matrix.target }}' | |
- name: 'Build' | |
shell: 'bash' | |
env: | |
RUSTFLAGS: -Dwarnings -Cstrip=symbols | |
run: | | |
pkgdir='target/pkg/MinedMap-${{ steps.tag.outputs.tag }}-${{ matrix.target }}' | |
mkdir -p "$pkgdir" | |
cargo build --release --target=${{ matrix.target }} | |
cp target/${{ matrix.target }}/release/minedmap${{ matrix.ext }} "$pkgdir"/ | |
- name: 'Archive' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'MinedMap-${{ steps.tag.outputs.tag }}-${{ matrix.target }}' | |
path: 'target/pkg' | |
build-container: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
steps: | |
- name: 'Checkout' | |
uses: 'actions/checkout@v4' | |
- name: 'Get version' | |
id: 'tag' | |
run: | | |
set -o pipefail | |
git fetch --prune --unshallow --tags -f | |
echo "tag=$(git describe --abbrev=7 --match='v*' | sed 's/^v//')" >> $GITHUB_OUTPUT | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/neocturne/minedmap/minedmap | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=ref,event=branch | |
type=ref,event=branch,suffix=-{{sha}} | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Login to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/setup-buildx-action@v3 | |
- name: Build | |
uses: docker/build-push-action@v6 | |
with: | |
build-args: | | |
MINEDMAP_VERSION=${{ steps.tag.outputs.tag }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
viewer-container: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
steps: | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/neocturne/minedmap/viewer | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=ref,event=branch | |
type=ref,event=branch,suffix=-{{sha}} | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Login to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/setup-buildx-action@v3 | |
- name: Build | |
uses: docker/build-push-action@v6 | |
with: | |
context: "{{defaultContext}}:viewer" | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |