Add MIT License to the project #78
This file contains hidden or 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: Go Build | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: [linux, darwin, windows] | |
| go: [1.21] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Build binary | |
| run: | | |
| OS=${{ matrix.os }} | |
| EXT="" | |
| if [ "$OS" = "windows" ]; then EXT=".exe"; fi | |
| mkdir -p build | |
| # Set GOOS and GOARCH for cross-compilation | |
| if [ "$OS" = "linux" ]; then | |
| GOOS=linux GOARCH=amd64 go build -o build/reasm-$OS$EXT | |
| elif [ "$OS" = "darwin" ]; then | |
| GOOS=darwin GOARCH=amd64 go build -o build/reasm-$OS$EXT | |
| elif [ "$OS" = "windows" ]; then | |
| GOOS=windows GOARCH=amd64 go build -o build/reasm-$OS$EXT | |
| fi | |
| - name: Upload artifact for commits | |
| if: github.event_name == 'push' && github.ref_type != 'tag' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: reasm-${{ matrix.os }} | |
| path: build/reasm-${{ matrix.os }}* |