Former-commit-id: e733111c91cb1e97a1a83e871e276abf8932e06f [formerly afdfb957095a1f4ec857225f67587fd59dc6b43a] [formerly 7f15f69bb27f8b778ce81b9ca983c2260480382d [formerly 1fd1288cb05c3e5e26f374ce9b7873f990d65b01]]
Former-commit-id: 9b3a9ea64d414fa9ea0a283293d805dc5a0f90c8 [formerly e7dae3aae96e9718868af5dc5213269ccd198c9c]
Former-commit-id: 07f4549c8f0b2e8fa5f93ac1089886932c5f4c49
Former-commit-id: 7b14a2155035f3a40dbb62c2056091ad35cfefe1
Former-commit-id: 7b055e4fde439c962e52f255f4d186db2baa7b7c
Former-commit-id: 40d5e9dde7c8ada4940d49ac367173c41f47c562 [formerly b8e58804e55e540f574707e9b762e45b91266c88]
Former-commit-id: 1775c08d28d9d5f63bad987bf022d56f18f92253
This commit is contained in:
Σrebe - Romain GERARD 2023-10-18 17:05:02 +02:00
parent 1c4205ff39
commit f3b01dc9c8
2 changed files with 129 additions and 129 deletions

View file

@ -1,128 +1,128 @@
on: #on:
# Indicates I want to run this workflow on all branches, PR, and tags # # Indicates I want to run this workflow on all branches, PR, and tags
push: # push:
branches: ["neo"] # branches: ["neo"]
tags: ["*"] # tags: ["*"]
pull_request: # pull_request:
branches: [ "main" ] # branches: [ "main" ]
#
env: #env:
RUST_VERSION: 1.73.0 # RUST_VERSION: 1.73.0
BUILD_ARGS: "--release" # BUILD_ARGS: "--release"
BIN_NAME: "wstunnel" # BIN_NAME: "wstunnel"
#
jobs: #jobs:
build: # build:
name: Build - ${{ matrix.platform.name }} # name: Build - ${{ matrix.platform.name }}
# By default, runs on Ubuntu, otherwise, override with the desired os # # By default, runs on Ubuntu, otherwise, override with the desired os
runs-on: ${{ matrix.platform.os || 'ubuntu-22.04' }} # runs-on: ${{ matrix.platform.os || 'ubuntu-22.04' }}
strategy: # strategy:
matrix: # matrix:
# Set platforms you want to build your binaries on # # Set platforms you want to build your binaries on
platform: # platform:
# Linux # # Linux
- name: Linux x86_64 # - name: Linux x86_64
target: x86_64-unknown-linux-musl # target: x86_64-unknown-linux-musl
#
- name: Linux aarch64 # - name: Linux aarch64
target: aarch64-unknown-linux-musl # target: aarch64-unknown-linux-musl
#
- name: Linux armv7hf # - name: Linux armv7hf
target: armv7-unknown-linux-musleabihf # target: armv7-unknown-linux-musleabihf
#
#- name: Linux mips # #- name: Linux mips
# target: mips-unknown-linux-musl # # target: mips-unknown-linux-musl
#
#- name: Linux mips64 # #- name: Linux mips64
# target: mips64-unknown-linux-muslabi64 # # target: mips64-unknown-linux-muslabi64
#
# Mac OS # # Mac OS
- name: MacOS x86_64 # - name: MacOS x86_64
target: x86_64-apple-darwin # target: x86_64-apple-darwin
#
# - name: iOS x86_64 # # - name: iOS x86_64
# target: x86_64-apple-ios # # target: x86_64-apple-ios
#
#- name: MacOS aarch64 # #- name: MacOS aarch64
# target: aarch64-apple-darwin # # target: aarch64-apple-darwin
#
#- name: iOS aarch64 # #- name: iOS aarch64
# target: aarch64-apple-ios # # target: aarch64-apple-ios
#
#
# Windows # # Windows
- name: Windows x86_64 # - name: Windows x86_64
os: windows-latest # os: windows-latest
target: x86_64-pc-windows-msvc # target: x86_64-pc-windows-msvc
#
steps: # steps:
- name: Create annotation for build error # - name: Create annotation for build error
if: contains(matrix.platform.target, 'linux') # if: contains(matrix.platform.target, 'linux')
run: sudo apt install musl-tools # run: sudo apt install musl-tools
#
- name: Checkout Git repo # - name: Checkout Git repo
uses: actions/checkout@v3 # uses: actions/checkout@v3
#
# Linux & Windows # # Linux & Windows
- name: Install rust toolchain # - name: Install rust toolchain
if: ${{ !contains(matrix.platform.target, 'apple') }} # if: ${{ !contains(matrix.platform.target, 'apple') }}
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
# We setup Rust toolchain and the desired target # # We setup Rust toolchain and the desired target
profile: minimal # profile: minimal
toolchain: "${{ env.RUST_VERSION }}" # toolchain: "${{ env.RUST_VERSION }}"
override: true # override: true
target: ${{ matrix.platform.target }} # target: ${{ matrix.platform.target }}
components: rustfmt, clippy # components: rustfmt, clippy
- name: Build ${{ matrix.platform.name }} binary # - name: Build ${{ matrix.platform.name }} binary
if: ${{ !contains(matrix.platform.target, 'apple') }} # if: ${{ !contains(matrix.platform.target, 'apple') }}
uses: actions-rs/cargo@v1 # uses: actions-rs/cargo@v1
# We use cross-rs if not running on x86_64 architecture on Linux # # We use cross-rs if not running on x86_64 architecture on Linux
with: # with:
command: build # command: build
use-cross: ${{ !contains(matrix.platform.target, 'x86_64') }} # use-cross: ${{ !contains(matrix.platform.target, 'x86_64') }}
args: ${{ env.BUILD_ARGS }} --target ${{ matrix.platform.target }} # args: ${{ env.BUILD_ARGS }} --target ${{ matrix.platform.target }}
#
# Mac OS # # Mac OS
- name: Build ${{ matrix.platform.name }} binary # - name: Build ${{ matrix.platform.name }} binary
if: contains(matrix.platform.target, 'apple') # if: contains(matrix.platform.target, 'apple')
# We use a dedicated Rust image containing required Apple libraries to cross-compile on multiple archs # # We use a dedicated Rust image containing required Apple libraries to cross-compile on multiple archs
run: | # run: |
docker run --rm --volume "${PWD}":/root/src --workdir /root/src joseluisq/rust-linux-darwin-builder:$RUST_VERSION \ # docker run --rm --volume "${PWD}":/root/src --workdir /root/src joseluisq/rust-linux-darwin-builder:$RUST_VERSION \
sh -c "CC=o64-clang CXX=o64-clang++ cargo build $BUILD_ARGS --target ${{ matrix.platform.target }}" # sh -c "CC=o64-clang CXX=o64-clang++ cargo build $BUILD_ARGS --target ${{ matrix.platform.target }}"
#
- name: Store artifact # - name: Store artifact
uses: actions/upload-artifact@v3 # uses: actions/upload-artifact@v3
with: # with:
# Finally, we store the binary as GitHub artifact for later usage # # Finally, we store the binary as GitHub artifact for later usage
name: ${{ matrix.platform.target }}-${{ env.BIN_NAME }} # name: ${{ matrix.platform.target }}-${{ env.BIN_NAME }}
path: target/${{ matrix.platform.target }}/release/${{ env.BIN_NAME }}${{ contains(matrix.platform.target, 'windows') && '.exe' || '' }} # path: target/${{ matrix.platform.target }}/release/${{ env.BIN_NAME }}${{ contains(matrix.platform.target, 'windows') && '.exe' || '' }}
retention-days: 1 # retention-days: 1
#
release: # release:
name: Release # name: Release
needs: [build] # needs: [build]
# We run the release job only if a tag starts with 'v' letter # # We run the release job only if a tag starts with 'v' letter
if: startsWith( github.ref, 'refs/tags/v' ) # if: startsWith( github.ref, 'refs/tags/v' )
runs-on: ubuntu-22.04 # runs-on: ubuntu-22.04
steps: # steps:
- name: Checkout Git repo # - name: Checkout Git repo
uses: actions/checkout@v3 # uses: actions/checkout@v3
#
# Download all artifacts # # Download all artifacts
- uses: actions/download-artifact@v3 # - uses: actions/download-artifact@v3
with: # with:
path: artifacts # path: artifacts
#
# Goreleaser # # Goreleaser
- name: Set up Go # - name: Set up Go
uses: actions/setup-go@v4 # uses: actions/setup-go@v4
- name: Run GoReleaser # - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5 # uses: goreleaser/goreleaser-action@v5
with: # with:
distribution: goreleaser # distribution: goreleaser
version: latest # version: latest
# Run goreleaser and ignore non-committed files (downloaded artifacts) # # Run goreleaser and ignore non-committed files (downloaded artifacts)
args: release --clean --skip=validate # args: release --clean --skip=validate
env: # env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

View file

@ -60,6 +60,6 @@ ci = ["github"]
# The installers to generate for each app # The installers to generate for each app
installers = [] installers = []
# Target platforms to build apps for (Rust target-triple syntax) # Target platforms to build apps for (Rust target-triple syntax)
targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-msvc"] targets = ["armv7-unknown-linux-musleabihf", "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc"]
# Publish jobs to run in CI # Publish jobs to run in CI
pr-run-mode = "skip" pr-run-mode = "skip"