Skip to content

Update rust.yml

Update rust.yml #3

Workflow file for this run

name: Rust CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-13, macos-14]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
run: cargo build --release
- name: Archive Production Artifacts
run: |
cp target/release/jtxt jtxt-{matrix.os}
shell: bash
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: jtxt-{matrix.os}
build-win:
runs-on: windows-2022
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
run: cargo build --release
- name: Archive Production Artifacts
run: |
cp target/release/jtxt jtxt-win64.exe
shell: bash
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: jtxt-win64.exe
release:
if: startsWith(github.ref, 'refs/tags/')
needs: ["build", "build-win"]
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
files: artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}