Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeWaka committed Sep 6, 2023
1 parent 5bcebe7 commit 8e70b57
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
indent_size = 2
102 changes: 102 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Release

on:
push:
tags:
- "v[0-9]+(\\.[0-9]+)*([-\\.]\\S+)?"

env:
# This is required to enable the web_sys clipboard API which egui_web uses
# https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html
# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
RUSTFLAGS: --cfg=web_sys_unstable_apis

jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-pc-windows-msvc
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- name: Clippy (all features)
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: clippy
args: --target x86_64-pc-windows-msvc --locked -- -D warnings

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: fmt
args: -- --check

- name: Build (release) (default features)
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: build
args: --target x86_64-pc-windows-msvc --locked --release

- uses: actions/upload-artifact@v3
with:
name: Windows Build
path: |
target/x86_64-pc-windows-msvc/release/meta-yoinker.exe
build-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu

- uses: Swatinem/rust-cache@v2

- name: Check
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: check
args: --target x86_64-unknown-linux-gnu --locked

- name: Build (Debug)
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: build
args: --target x86_64-unknown-linux-gnu --locked

- name: Run tests
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: test
args: --target x86_64-unknown-linux-gnu --locked
env:
BYOND_BIN: /home/runner/BYOND/byond/bin

- name: Build (release)
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: build
args: --target x86_64-unknown-linux-gnu --locked --release

- uses: actions/upload-artifact@v3
with:
name: Linux Build
path: |
target/x86_64-unknown-linux-gnu/release/meta-yoinker

0 comments on commit 8e70b57

Please sign in to comment.