-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Zac8668/astratomic
- Loading branch information
Showing
7 changed files
with
175 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
name: 🚀 Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
generate_changelog: | ||
name: 📜 Generate Changelog | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_body: ${{ steps.git-cliff.outputs.content }} | ||
steps: | ||
- name: ⬇️ Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 📠 Calculate Git Cliff Args | ||
id: cliff-args | ||
run: | | ||
if [ "${{ github.event_name }}" = "push" ]; then | ||
echo "args=--latest" >> $GITHUB_OUTPUT | ||
else | ||
echo "args=--unreleased" >> $GITHUB_OUTPUT | ||
fi | ||
- name: 📜 Generate Changelog | ||
uses: orhun/git-cliff-action@v2 | ||
id: git-cliff | ||
with: | ||
args: -vv --strip all ${{ steps.cliff-args.outputs.args }} | ||
|
||
- name: 📝 Set Job Summary | ||
run: | | ||
echo "${{ steps.git-cliff.outputs.content }}" >> $GITHUB_STEP_SUMMARY | ||
build_release: | ||
name: 🔨 Build | ||
runs-on: ${{ matrix.config.os }} | ||
continue-on-error: true | ||
outputs: | ||
release_version: ${{ env.RELEASE_VERSION }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { os: ubuntu-latest, target: "x86_64-unknown-linux-gnu" } | ||
- { os: ubuntu-latest, target: "aarch64-unknown-linux-gnu" } | ||
- { os: macos-latest, target: "x86_64-apple-darwin" } | ||
- { os: macos-latest, target: "aarch64-apple-darwin" } | ||
- { os: windows-latest, target: "x86_64-pc-windows-msvc" } | ||
|
||
steps: | ||
- name: 📠 Calculate Release Version | ||
run: | | ||
if [ "${{ github.event_name }}" = "workflow_dispatch" -o "${{ github.event_name }}" = "schedule" ]; then | ||
echo "RELEASE_VERSION=nightly-$(date '+%Y-%m-%d')" >> $GITHUB_ENV | ||
else | ||
echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | ||
fi | ||
- name: ⬇️ Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🦀 Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
profile: minimal | ||
target: ${{ matrix.config.target }} | ||
|
||
- name: 🔨 Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --locked --target ${{ matrix.config.target }} | ||
use-cross: true | ||
|
||
- name: ⚙️ Prepare artifacts [Windows] | ||
shell: bash | ||
if: matrix.config.os == 'windows-latest' | ||
run: | | ||
release_dir="astratomic-${{ env.RELEASE_VERSION }}" | ||
artifact_path="astratomic-${{ env.RELEASE_VERSION }}-${{ matrix.config.target }}.zip" | ||
echo "ARTIFACT_PATH=$artifact_path" >> $GITHUB_ENV | ||
mkdir $release_dir | ||
cp target/${{ matrix.config.target }}/release/astratomic.exe $release_dir/ | ||
cp -R assets/ $release_dir/ | ||
cp LICENSE $release_dir/ | ||
7z a -tzip $artifact_path $release_dir/ | ||
- name: ⚙️ Prepare artifacts [Unix] | ||
shell: bash | ||
if: matrix.config.os != 'windows-latest' | ||
run: | | ||
release_dir="astratomic-${{ env.RELEASE_VERSION }}" | ||
artifact_path="astratomic-${{ env.RELEASE_VERSION }}-${{ matrix.config.target }}.tar.gz" | ||
echo "ARTIFACT_PATH=$artifact_path" >> $GITHUB_ENV | ||
mkdir $release_dir | ||
cp target/${{ matrix.config.target }}/release/astratomic $release_dir/ | ||
cp -R assets $release_dir | ||
cp LICENSE $release_dir | ||
tar -czvf $artifact_path $release_dir/ | ||
- name: ⏫️ Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.ARTIFACT_PATH }} | ||
path: ${{ env.ARTIFACT_PATH }} | ||
if-no-files-found: error | ||
|
||
publish_release: | ||
name: 🚀 Publish | ||
needs: | ||
- generate_changelog | ||
- build_release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: ⬇️ Download Artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: 🔒 Generate Checksums | ||
run: for file in astratomic-*/astratomic-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done | ||
|
||
- name: 🚀 Publish Release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
release_name: ${{ needs.build_release.outputs.release_version }} | ||
file: astratomic-*/astratomic-* | ||
file_glob: true | ||
overwrite: true | ||
prerelease: ${{ github.event_name != 'push' }} | ||
body: ${{ needs.generate_changelog.outputs.release_body }} | ||
tag: ${{ needs.build_release.outputs.release_version }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
use crate::atom::State; | ||
use crate::prelude::*; | ||
|
||
#[derive(Component, Clone, Copy)] | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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