name: Build
run-name: Im about to BUILLLLDDDDDDD
on:
  push:
    branches:
      - 'master'

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v4
      - name: Install Rust
        run: curl https://sh.rustup.rs -sSf | sh -s -- -y && . "$HOME/.cargo/env" && rustup target add x86_64-pc-windows-gnu
      - name: Build linux
        run: cargo build --release
      - name: Build Windows
        run: cargo build --release --target x86_64-pc-windows-gnu
      - name: Hash Release
        id: get-hash
        run: |
          echo "TAG_NAME=$(cat VERSION.txt)" >> $GITHUB_OUTPUT
      - name: Publish
        uses: akkuman/gitea-release-action@v1
        env:
          NODE_OPTIONS: '--trace-warnings'
        with:
          sha256sum: true
          body_path: ./CHANGES.md
          tag_name: '${{steps.get-hash.outputs.TAG_NAME}}'
          name: v'${{steps.get-hash.outputs.TAG_NAME}}''
          files: |-
            ./target/release/rsa
            ./target/x86_64-pc-windows-gnu/release/rsa.exe