diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 0f85127..76736ad 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,4 +1,4 @@ -name: Main +name: Linux on: push diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..9937964 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,42 @@ +name: Windows + +on: push + +jobs: + build: + runs-on: windows-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Rust stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Build & Test + run: cargo test + + - name: Get Termcalc Version + if: startsWith(github.ref, 'refs/tags/') + run: | + cargo install cargo-get + echo "TC_VERSION=$(cargo get package.version)" | Out-File -FilePath $env:GITHUB_ENV -Append + + - name: Build Windows release + if: startsWith(github.ref, 'refs/tags/') + run: | + cargo build --release + md target/dist + cp target/release/tc.exe target/dist/termcalc-${{ env.TC_VERSION }}-x86_64.exe + + - name: Upload Release Executable + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + target/dist/termcalc-${{ env.TC_VERSION }}-x86_64.exe +