Skip to navigation
Compile and publish Linux and Windows Rust Binaries Releases on GitHub Action
15.08.24
# Compile and publish Linux and Windows Rust Binaries Releases on GitHub Action ```yaml name: Build Linux/Windows Release on: push: branches: ["main"] tags: - '*' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: permissions: contents: write pull-requests: write issues: read packages: none jobs: # Single deploy job since we're just deploying build_linux_windows: if: github.repository_owner == 'myridia' runs-on: ubuntu-latest steps: - name: Install Dependencies run: | sudo apt-get install curl build-essential gcc make mingw-w64 -y sudo apt-get install rustc cargo gzip -y sudo apt-get install g++ zlib1g-dev libmpc-dev libmpfr-dev libgmp-dev - name: Checkout repository uses: actions/checkout@v4 - name: list_targets run: | rustup target list - name: add_targets run: | rustup target add x86_64-pc-windows-gnu rustup target add x86_64-unknown-linux-gnu - name: Compile windows run: | cargo build --target x86_64-pc-windows-gnu --release - name: compile linux run: | cargo build --target x86_64-unknown-linux-gnu --release - name: List binary run: | ls target/x86_64-pc-windows-gnu/release ls target/x86_64-unknown-linux-gnu/release - name: rename binaries run: | cp target/x86_64-unknown-linux-gnu/release/couchy target/x86_64-unknown-linux-gnu/release/couchy_linux cp target/x86_64-pc-windows-gnu/release/couchy.exe target/x86_64-pc-windows-gnu/release/couchy_windows.exe - name: Upload Linux Binary to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: 'target/x86_64-unknown-linux-gnu/release/couchy_linux' tag: ${{ github.ref }} overwrite: true file_glob: true - name: Upload Windows Binary to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: 'target/x86_64-pc-windows-gnu/release/couchy_windows.exe' tag: ${{ github.ref }} overwrite: true file_glob: true ```
https://github.com/myridia/couchy/tree/main/.github/workflows
Reply
Anonymous
Information Epoch 1735327999
Live free or die.
Home
Notebook
Contact us