From e155572b56b8b5c5773f44cbd5ab6f8962d2d6df Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 5 Dec 2023 17:10:13 -0800 Subject: [PATCH 1/3] Add workflow. --- .github/workflows/nightly.yml | 90 +++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..5283c6fbe --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,90 @@ +name: Release + +on: + # Canary from develop branches + push: + branches: + - develop-* + # Nightly every day at midnight + schedule: + - cron: "0 0 * * *" + # Uncomment to test in PRs (its safe) + pull_request: + +permissions: + contents: write + id-token: write + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-gnu + host: ubuntu-20.04 + ext: "" + + - target: x86_64-apple-darwin + host: macos-12 + ext: "" + setup: | + export MACOSX_DEPLOYMENT_TARGET="10.13"; + + - target: aarch64-apple-darwin + host: macos-12 + ext: "" + setup: | + export CC=$(xcrun -f clang); + export CXX=$(xcrun -f clang++); + export SDKROOT=$(xcrun -sdk macosx --show-sdk-path); + export CFLAGS="-isysroot $SDKROOT -isystem $SDKROOT"; + export MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version); + + - target: x86_64-pc-windows-msvc + host: windows-2022 + ext: .exe + name: Stable - ${{ matrix.target }} + runs-on: ${{ matrix.host }} + steps: + - uses: actions/checkout@v4 + - uses: moonrepo/setup-rust@v1 + with: + cache: false + - name: Setup toolchain + if: ${{ matrix.setup }} + run: ${{ matrix.setup }} + - name: Build binary + run: | + rustup target add ${{ matrix.target }} + cargo build --release --target ${{ matrix.target }} + - name: Rename binary + run: mv ./target/${{ matrix.target }}/release/proto${{ matrix.ext }} ./proto-${{ matrix.target }}${{ matrix.ext }} + # Canary + - if: ${{ github.event_name == 'push' && contains(github.ref, 'develop-') }} + uses: ncipollo/release-action@v1 + name: Create GitHub release + with: + allowUpdates: true + artifactErrorsFailBuild: true + artifacts: proto-${{ matrix.target }}${{ matrix.ext }} + body: "This canary release corresponds to the commit [${{ github.sha }}]." + name: "Canary" + tag: "canary" + prerelease: true + replacesArtifacts: true + skipIfReleaseExists: false + # Nightly + - if: ${{ github.event_name == 'schedule' }} + uses: ncipollo/release-action@v1 + name: Create GitHub release + with: + allowUpdates: true + artifactErrorsFailBuild: true + artifacts: proto-${{ matrix.target }}${{ matrix.ext }} + body: "This nightly release corresponds to the commit [${{ github.sha }}]." + name: "Nightly" + tag: "nightly" + prerelease: true + replacesArtifacts: true + skipIfReleaseExists: false From 62eab11522910758aa70c606fea0cfb03f057b57 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 5 Dec 2023 17:25:41 -0800 Subject: [PATCH 2/3] Comment out. --- .github/workflows/nightly.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5283c6fbe..0afc8cfa9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,4 +1,4 @@ -name: Release +name: Release nightly / canary on: # Canary from develop branches @@ -61,7 +61,7 @@ jobs: - name: Rename binary run: mv ./target/${{ matrix.target }}/release/proto${{ matrix.ext }} ./proto-${{ matrix.target }}${{ matrix.ext }} # Canary - - if: ${{ github.event_name == 'push' && contains(github.ref, 'develop-') }} + - # if: ${{ github.event_name == 'push' && contains(github.ref, 'develop-') }} uses: ncipollo/release-action@v1 name: Create GitHub release with: @@ -75,7 +75,7 @@ jobs: replacesArtifacts: true skipIfReleaseExists: false # Nightly - - if: ${{ github.event_name == 'schedule' }} + - # if: ${{ github.event_name == 'schedule' }} uses: ncipollo/release-action@v1 name: Create GitHub release with: From 5a73489bcbc20bf376d76f3ed9ac841b0d2860ec Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 5 Dec 2023 18:36:42 -0800 Subject: [PATCH 3/3] Bring back. --- .github/workflows/nightly.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0afc8cfa9..a5d741997 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -9,7 +9,7 @@ on: schedule: - cron: "0 0 * * *" # Uncomment to test in PRs (its safe) - pull_request: + # pull_request: permissions: contents: write @@ -61,7 +61,7 @@ jobs: - name: Rename binary run: mv ./target/${{ matrix.target }}/release/proto${{ matrix.ext }} ./proto-${{ matrix.target }}${{ matrix.ext }} # Canary - - # if: ${{ github.event_name == 'push' && contains(github.ref, 'develop-') }} + - if: ${{ github.event_name == 'push' && contains(github.ref, 'develop-') }} uses: ncipollo/release-action@v1 name: Create GitHub release with: @@ -75,7 +75,7 @@ jobs: replacesArtifacts: true skipIfReleaseExists: false # Nightly - - # if: ${{ github.event_name == 'schedule' }} + - if: ${{ github.event_name == 'schedule' }} uses: ncipollo/release-action@v1 name: Create GitHub release with: