diff --git a/.github/workflows/goreleaser-config-check.yaml b/.github/workflows/goreleaser-config-check.yaml new file mode 100644 index 00000000..497b7b68 --- /dev/null +++ b/.github/workflows/goreleaser-config-check.yaml @@ -0,0 +1,26 @@ +--- +name: GoReleaser config check +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + paths: + - .goreleaser.yaml + workflow_dispatch: + +jobs: + goreleaser-check: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - uses: goreleaser/goreleaser-action@v6 + with: + install-only: true + + - name: goreleaser check + run: goreleaser check diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..384da0d3 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,113 @@ +# .goreleaser.yaml for rpcpool/photon +# +# This file must be committed to the root of the photon source repo. +# GCS upload, cosigning, and GitHub Release publishing are injected via +# ci/goreleaser-patch.yaml in Binaries-ci at build time. +# +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json + +version: 2 + +builds: + - id: photon + builder: rust + binary: photon + targets: + - x86_64-unknown-linux-gnu + flags: + - --release + - --bin=photon + env: + - OPENSSL_INCLUDE_DIR=/usr/include + - OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu + - CFLAGS_x86_64_unknown_linux_gnu=-isystem /usr/include/x86_64-linux-gnu + + - id: photon-migration + builder: rust + binary: photon-migration + targets: + - x86_64-unknown-linux-gnu + flags: + - --release + - --bin=photon-migration + env: + - OPENSSL_INCLUDE_DIR=/usr/include + - OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu + - CFLAGS_x86_64_unknown_linux_gnu=-isystem /usr/include/x86_64-linux-gnu + + - id: photon-openapi + builder: rust + binary: photon-openapi + targets: + - x86_64-unknown-linux-gnu + flags: + - --release + - --bin=photon-openapi + env: + - OPENSSL_INCLUDE_DIR=/usr/include + - OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu + - CFLAGS_x86_64_unknown_linux_gnu=-isystem /usr/include/x86_64-linux-gnu + + - id: photon-snapshot-loader + builder: rust + binary: photon-snapshot-loader + targets: + - x86_64-unknown-linux-gnu + flags: + - --release + - --bin=photon-snapshot-loader + env: + - OPENSSL_INCLUDE_DIR=/usr/include + - OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu + - CFLAGS_x86_64_unknown_linux_gnu=-isystem /usr/include/x86_64-linux-gnu + + - id: photon-snapshotter + builder: rust + binary: photon-snapshotter + targets: + - x86_64-unknown-linux-gnu + flags: + - --release + - --bin=photon-snapshotter + env: + - OPENSSL_INCLUDE_DIR=/usr/include + - OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu + - CFLAGS_x86_64_unknown_linux_gnu=-isystem /usr/include/x86_64-linux-gnu + +archives: + - id: photon + ids: [photon] + name_template: photon-linux-amd64 + formats: [binary] + + - id: photon-migration + ids: [photon-migration] + name_template: photon-migration-linux-amd64 + formats: [binary] + + - id: photon-openapi + ids: [photon-openapi] + name_template: photon-openapi-linux-amd64 + formats: [binary] + + - id: photon-snapshot-loader + ids: [photon-snapshot-loader] + name_template: photon-snapshot-loader-linux-amd64 + formats: [binary] + + - id: photon-snapshotter + ids: [photon-snapshotter] + name_template: photon-snapshotter-linux-amd64 + formats: [binary] + +release: + github: + owner: rpcpool + name: photon + draft: true + header: | + rust {{ .Env.RUST_VERSION }} + +changelog: + sort: asc + use: github diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..2ca2cb16 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "stable" +components = ["rustfmt", "rustc-dev", "clippy", "cargo"]