Rework the code and TUI #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Workflow | |
on: | |
push: | |
branches: | |
- master | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- os: linux | |
arch: "amd64" | |
- os: linux | |
arch: "arm64" | |
- os: darwin | |
arch: "amd64" | |
- os: darwin | |
arch: "arm64" | |
- os: windows | |
arch: "386" | |
- os: windows | |
arch: "amd64" | |
name: Build and save artifact | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
uses: actions/setup-go@v3 | |
with: | |
go-version: v1.18 | |
- name: Set .exe extension for Windows | |
run: echo "EXTENSION=.exe" >> $GITHUB_ENV | |
if: matrix.target.os == 'windows' | |
- name: Set executable filename | |
run: echo "FILENAME=sshs-${{ matrix.target.os }}-${{ matrix.target.arch }}${{ env.EXTENSION }}" >> $GITHUB_ENV | |
- name: Build | |
run: make build OUTPUT=bin/${{ env.FILENAME }} | |
env: | |
GOOS: "${{ matrix.target.os }}" | |
GOARCH: "${{ matrix.target.arch }}" | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.FILENAME }} | |
path: bin/${{ env.FILENAME }} | |
nix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v17 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- run: nix build | |
- run: nix flake check | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: v1.18 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest |