Skip to content

Commit

Permalink
Merge pull request #387 from Lodestone-Team/dev
Browse files Browse the repository at this point in the history
Merge dev into main for release
  • Loading branch information
CheatCod authored Jun 18, 2024
2 parents 12c0d54 + 2f6a858 commit de2f840
Show file tree
Hide file tree
Showing 168 changed files with 6,066 additions and 992 deletions.
11 changes: 11 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# uncomment this if you have mold linker installed

# [target.x86_64-unknown-linux-gnu]
# linker = "/usr/bin/clang"
# rustflags = ["-C", "link-arg=--ld-path=/usr/bin/mold"]

[profile.release]
strip = true
opt-level= "s"
lto = "thin"
codegen-units = 1
20 changes: 4 additions & 16 deletions .github/workflows/core-build-and-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,6 @@ jobs:
arch: "x86_64"
postfix: ""
cross: false
- platform: "self-hosted"
target: "aarch64-unknown-linux-gnu"
os: "linux"
arch: "aarch64"
postfix: ""
cross: false
- platform: "macos-latest"
target: "x86_64-apple-darwin"
os: "macos"
arch: "x86_64"
postfix: ""
cross: false

runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -58,7 +46,7 @@ jobs:
with:
toolchain: stable
profile: minimal
override: true
override: false
target: ${{ matrix.target }}

- name: Install dependencies (ubuntu only)
Expand Down Expand Up @@ -109,18 +97,18 @@ jobs:
with:
use-cross: ${{ matrix.cross }}
command: build
args: --release --features "vendored-openssl" --target ${{ matrix.target }}
args: --profile=github-release --features "vendored-openssl" --target ${{ matrix.target }}

- name: Rename File (Linux, MacOS)
if: runner.os != 'Windows'
run: |
mv ./target/${{ matrix.target }}/release/main${{ matrix.postfix }} ./${{ env.FILENAME }}
mv ./target/${{ matrix.target }}/github-release/lodestone_core${{ matrix.postfix }} ./${{ env.FILENAME }}
- name: Rename File (Windows)
if: runner.os == 'Windows'
run: |
echo "::debug::$(ls)"
Move-Item -Path "./target/${{ matrix.target }}/release/main${{ matrix.postfix }}" -Destination "./${{ env.FILENAME }}"
Move-Item -Path "./target/${{ matrix.target }}/github-release/lodestone_core${{ matrix.postfix }}" -Destination "./${{ env.FILENAME }}"
# for debugging
echo "::debug::Listing files in current directory"
echo "::debug::$(ls)"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/core-cargo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
target: x86_64-pc-windows-msvc
- platform: ubuntu-latest
target: x86_64-unknown-linux-gnu
- platform: macos-latest
target: x86_64-apple-darwin

runs-on: ${{ matrix.platform }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/core-clippy-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
toolchain: stable
components: clippy
override: true
override: false

- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/core-release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: ${{ github.repository }}_core

jobs:
core-release-docker:
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/dashboard-release-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Dashboard - Release Docker

on:
release:
types: [published]
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: "${{ github.repository }}_dashboard"

jobs:
dashboard-release-docker:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dashboard

steps:
- name: checkout repository
uses: actions/checkout@v3
- name: set up QEMU
uses: docker/setup-qemu-action@v2
- name: set up docker buildx
uses: docker/setup-buildx-action@v2
- name: log in to the container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: string_tag
uses: ASzc/change-string-case-action@v5
with:
string: ${{ env.REGISTRY}}/${{ env.IMAGE_NAME }}

# https://stackoverflow.com/questions/73402042/github-action-expressions-split-string
- name: set version string
env:
VERSION: ${{ steps.release_asset.outputs.version }}
id: substring
run: echo "version=${VERSION:1}" >> $GITHUB_OUTPUT

- name: set docker version label
env:
LABEL: ${{ !github.event.release.prerelease && 'latest-stable' || 'latest-beta' }}
id: release_type
run: echo "label=${LABEL}" >> $GITHUB_OUTPUT

- name: build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./Dockerfile
build-args: |
lodestone_version=${{ steps.release_asset.outputs.version }}
push: true
tags: |
${{ steps.string_tag.outputs.lowercase }}:latest
${{ steps.string_tag.outputs.lowercase }}:${{ steps.release_type.outputs.label }}
${{ steps.string_tag.outputs.lowercase }}:${{ steps.substring.outputs.version }}
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
dashboard-build-and-draft:
uses: ./.github/workflows/dashboard-build-and-draft.yml
needs: [workspace-check, core-cargo-test]
if: github.event.pull_request.head.repo == 'Lodestone-Team/lodestone'
if: github.event.pull_request.head.repo.full_name == 'Lodestone-Team/lodestone'
with:
debug: false
version: null
Expand All @@ -28,7 +28,7 @@ jobs:
core-build-and-draft:
uses: ./.github/workflows/core-build-and-draft.yml
needs: [workspace-check, core-cargo-test]
if: github.event.pull_request.head.repo == 'Lodestone-Team/lodestone'
if: github.event.pull_request.head.repo.full_name == 'Lodestone-Team/lodestone'
with:
version: null
secrets: inherit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
debug/
target/

.DS_Store

# These are backup files generated by rustfmt
**/*.rs.bk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"recommendations": [
"bradlc.vscode-tailwindcss",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
"dbaeumer.vscode-eslint",
"rust-lang.rust-analyzer",
"swellaby.rust-pack"
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.defaultFormatter": "rust-lang.rust-analyzer",
"editor.formatOnPaste": true,
"editor.formatOnSave": true
}
Loading

0 comments on commit de2f840

Please sign in to comment.