diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 55a9df8..ed182c9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -9,29 +9,76 @@ on: pull_request: branches: [ "main" ] +env: + GO_VERSION: '1.20' + jobs: - linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - name: Install libfido2-dev - run: sudo apt-get install -y libfido2-dev - - name: Install gio dependencies - run: sudo apt-get install -y gcc pkg-config - - name: Build - run: go build -v . - - name: Test - run: go test -v . - - uses: actions/upload-artifact@v3 - with: - name: goldwarden-linux - path: ./goldwarden + # build_linux_x86_64: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Go + # uses: actions/setup-go@v4 + # with: + # go-version: ${{ env.GO_VERSION }} + # - name: Install libfido2-dev + # run: sudo apt-get install -y libfido2-dev + # - name: Build + # run: go build -o goldwarden_linux_x86_64 -v . + # - uses: actions/upload-artifact@v3 + # with: + # name: goldwarden_linux_x86_64 + # path: ./goldwarden_linux_x86_64 + + # build_linux_arm64: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Go + # uses: actions/setup-go@v4 + # with: + # go-version: ${{ env.GO_VERSION }} + # - name: Install libfido2-dev + # run: sudo apt-get install -y libfido2-dev + # - name: Build minimal arm64 featureset + # run: GOARCH=arm64 go build -tags nofido2 -o goldwarden_linux_arm64 -v . + # - uses: actions/upload-artifact@v3 + # with: + # name: goldwarden_linux_arm64 + # path: ./goldwarden_linux_arm64 + + # build_linux_x86: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Go + # uses: actions/setup-go@v4 + # with: + # go-version: ${{ env.GO_VERSION }} + # - name: Build minimal x86 featureset + # run: GOARCH=386 go build -tags nofido2 -o goldwarden_linux_x86 -v . + # - uses: actions/upload-artifact@v3 + # with: + # name: goldwarden_linux_x86 + # path: ./goldwarden_linux_x86 - macos: + # build_macos_x86_64: + # runs-on: macos-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v1 + # - name: Set up Go + # uses: actions/setup-go@v4 + # with: + # go-version: ${{ env.GO_VERSION }} + # - name: Build + # run: go build -tags "nofido2" -o "goldwarden_macos_x86_64" -v . + # - uses: actions/upload-artifact@v3 + # with: + # name: goldwarden-macos_x86_64 + # path: ./goldwarden_macos_x86_64 + + build_macos_arm64: runs-on: macos-latest steps: - name: Checkout @@ -39,30 +86,28 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: ${{ env.GO_VERSION }} + - name: Install zig + run: brew install zig - name: Build - run: go build -tags "nofido2" -v . - - name: Test - run: go test -tags "nofido2" -v . + run: CGO_ENABLED=1 CC="zcc" CXX="zxx" GOARCH=arm64 go build -tags "nofido2" -o "goldwarden_macos_arm64" -v . - uses: actions/upload-artifact@v3 with: - name: goldwarden-macos - path: ./goldwarden + name: goldwarden-macos_arm64 + path: ./goldwarden_macos_arm64 - windows: - runs-on: windows-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - name: Build - run: go build -tags "nofido2" -v . - - name: Test - run: go test -tags "nofido2" -v . - - uses: actions/upload-artifact@v3 - with: - name: goldwarden-windows.exe - path: ./goldwarden.exe + # build_windows_x86_64: + # runs-on: windows-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v1 + # - name: Set up Go + # uses: actions/setup-go@v4 + # with: + # go-version: ${{ env.GO_VERSION }} + # - name: Build + # run: go build -tags "nofido2" -o "goldwarden_windows_x86_64.exe" -v . + # - uses: actions/upload-artifact@v3 + # with: + # name: goldwarden-windows_x86_64.exe + # path: ./goldwarden_windows_x86_64.exe \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2efe293..1aaa923 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,8 +6,11 @@ permissions: contents: write packages: write +env: + GO_VERSION: 1.20 + jobs: - build_linux: + build_linux_x86_64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -88,6 +91,40 @@ jobs: files: './*.rpm' repo-token: ${{ secrets.GITHUB_TOKEN }} + build_linux_arm64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install libfido2-dev + run: sudo apt-get install -y libfido2-dev + - name: Build minimal arm64 featureset + run: GOARCH=arm64 go build -tags nofido2 -o goldwarden_linux_arm64 -v . + - uses: AButler/upload-release-assets@v2.0 + with: + files: './goldwarden_linux_arm64' + repo-token: ${{ secrets.GITHUB_TOKEN }} + + build_linux_x86: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + - name: Build minimal x86 featureset + run: GOARCH=386 go build -tags nofido2 -o goldwarden_linux_x86 -v . + - uses: AButler/upload-release-assets@v2.0 + with: + files: './goldwarden_linux_x86' + repo-token: ${{ secrets.GITHUB_TOKEN }} + build_macos_x86_64: runs-on: macos-latest steps: @@ -96,13 +133,29 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: ${{ env.GO_VERSION }} - name: Build run: go build -tags "nofido2" -o "goldwarden_macos_x86_64" -v . - uses: AButler/upload-release-assets@v2.0 with: files: './goldwarden_macos_x86_64' repo-token: ${{ secrets.GITHUB_TOKEN }} + + build_macos_arm64: + runs-on: macos-13-xlarge + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + - name: Build + run: go build -tags "nofido2" -o "goldwarden_macos_arm64" -v . + - uses: AButler/upload-release-assets@v2.0 + with: + files: './goldwarden_macos_arm64' + repo-token: ${{ secrets.GITHUB_TOKEN }} build_windows_x86_64: runs-on: windows-latest @@ -112,7 +165,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: ${{ env.GO_VERSION }} - name: Build run: go build -tags "nofido2" -o "goldwarden_windows_x86_64.exe" -v . - uses: AButler/upload-release-assets@v2.0