diff --git a/.github/workflows/build-features.yaml b/.github/workflows/build-features.yaml new file mode 100644 index 00000000..96411ee5 --- /dev/null +++ b/.github/workflows/build-features.yaml @@ -0,0 +1,30 @@ +name: Development Build +on: + push: + branches: + - features +jobs: + build: + name: Dev Build on ${{ matrix.goos }} / ${{ matrix.goarch }} + runs-on: ubuntu-latest + strategy: + matrix: + goos: [darwin, linux, netbsd, openbsd, windows] + goarch: [amd64, arm64] + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.22.x + - name: Build project + run: | + GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \ + cd server && \ + go build -mod=vendor -tags="sonic avx" -ldflags="-s" -o nauthilus-${{ matrix.goos }}-${{ matrix.goarch }}-dev . + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: nauthilus-${{ matrix.goos }}-${{ matrix.goarch }}-dev-binary + path: server/nauthilus-${{ matrix.goos }}-${{ matrix.goarch }}-dev \ No newline at end of file diff --git a/.github/workflows/build-stable.yaml b/.github/workflows/build-stable.yaml new file mode 100644 index 00000000..0d1db34a --- /dev/null +++ b/.github/workflows/build-stable.yaml @@ -0,0 +1,34 @@ +name: Release Build +on: + push: + tags: + - '*' +jobs: + build: + name: Release Build on ${{ matrix.goos }} / ${{ matrix.goarch }} + runs-on: ubuntu-latest + strategy: + matrix: + goos: [darwin, linux, netbsd, openbsd, windows] + goarch: [amd64, arm64] + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.22.x + - name: Build project + run: | + GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \ + cd server && \ + go build -mod=vendor -tags="sonic avx" -ldflags="-s" -o nauthilus-${{ matrix.goos }}-${{ matrix.goarch }} . + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: nauthilus-${{ matrix.goos }}-${{ matrix.goarch }}-binary + path: server/nauthilus-${{ matrix.goos }}-${{ matrix.goarch }} + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: server/nauthilus-${{ matrix.goos }}-${{ matrix.goarch }} \ No newline at end of file diff --git a/.github/workflows/docker-features.yaml b/.github/workflows/docker-features.yaml new file mode 100644 index 00000000..c635a983 --- /dev/null +++ b/.github/workflows/docker-features.yaml @@ -0,0 +1,28 @@ +name: Development Docker Build +on: + push: + branches: + - features +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GHCR_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/nauthilus:dev \ No newline at end of file diff --git a/.github/workflows/docker-stable.yaml b/.github/workflows/docker-stable.yaml new file mode 100644 index 00000000..4861655d --- /dev/null +++ b/.github/workflows/docker-stable.yaml @@ -0,0 +1,28 @@ +name: Production Docker Build +on: + push: + tags: + - '*' +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GHCR_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/nauthilus:latest \ No newline at end of file