From 74ba00a22200e320033797dc50770c054c4ba9d5 Mon Sep 17 00:00:00 2001 From: Justin Ma Date: Thu, 8 Jun 2023 21:15:56 +0800 Subject: [PATCH] Try to add a nightly-build checking workflow (#9385) # Description Try to add a nightly-build workflow, relevant issue: https://github.com/nushell/nushell/issues/9383 1. It will try to build the release binaries nightly at 3 am 1. It will create an issue like this: https://github.com/hustcer/nu-release/issues/37 if the build fails 2. Add a Nightly Build status badge to README.md --- .github/ISSUE_TEMPLATE/nightly-build-fail.md | 16 +++ .github/workflows/nightly-build.yml | 113 +++++++++++++++++++ README.md | 1 + 3 files changed, 130 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/nightly-build-fail.md create mode 100644 .github/workflows/nightly-build.yml diff --git a/.github/ISSUE_TEMPLATE/nightly-build-fail.md b/.github/ISSUE_TEMPLATE/nightly-build-fail.md new file mode 100644 index 0000000000..5013e09a02 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/nightly-build-fail.md @@ -0,0 +1,16 @@ +--- +name: Nightly build of release binaries failed +about: Used to submit issues related to binaries release workflow +title: 'Attention: Nightly build of release binaries failed' +labels: ['build-package', 'priority'] +assignees: '' + +--- + +**Nightly build of release binaries failed** + +Hi there: + +If you see me here that means there is a release failure for the nightly build + +Please **click the status badge** to see more details: [![Nightly Build](https://github.com/nushell/nushell/actions/workflows/nightly-build.yml/badge.svg)](https://github.com/nushell/nushell/actions/workflows/nightly-build.yml) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml new file mode 100644 index 0000000000..4c9bcf6e4a --- /dev/null +++ b/.github/workflows/nightly-build.yml @@ -0,0 +1,113 @@ +# +# REF: +# 1. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude +# 2. https://github.com/JasonEtco/create-an-issue +# +name: Nightly Build + +on: + # push: + # branches: + # - feature/release + schedule: + - cron: '0 3 * * *' # run at 3 AM UTC + +defaults: + run: + shell: bash + +jobs: + all: + name: All + + strategy: + fail-fast: false + matrix: + target: + - aarch64-apple-darwin + - x86_64-apple-darwin + - x86_64-pc-windows-msvc + - aarch64-pc-windows-msvc + - x86_64-unknown-linux-gnu + - x86_64-unknown-linux-musl + - aarch64-unknown-linux-gnu + - armv7-unknown-linux-gnueabihf + - riscv64gc-unknown-linux-gnu + extra: ['bin'] + include: + - target: aarch64-apple-darwin + os: macos-latest + target_rustflags: '' + - target: x86_64-apple-darwin + os: macos-latest + target_rustflags: '' + - target: x86_64-pc-windows-msvc + extra: 'bin' + os: windows-latest + target_rustflags: '' + - target: x86_64-pc-windows-msvc + extra: msi + os: windows-latest + target_rustflags: '' + - target: aarch64-pc-windows-msvc + extra: 'bin' + os: windows-latest + target_rustflags: '' + - target: aarch64-pc-windows-msvc + extra: msi + os: windows-latest + target_rustflags: '' + - target: x86_64-unknown-linux-gnu + os: ubuntu-20.04 + target_rustflags: '' + - target: x86_64-unknown-linux-musl + os: ubuntu-20.04 + target_rustflags: '' + - target: aarch64-unknown-linux-gnu + os: ubuntu-20.04 + target_rustflags: '' + - target: armv7-unknown-linux-gnueabihf + os: ubuntu-20.04 + target_rustflags: '' + - target: riscv64gc-unknown-linux-gnu + os: ubuntu-20.04 + target_rustflags: '' + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v3 + + - name: Update Rust Toolchain Target + run: | + echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml + + - name: Setup Rust toolchain and cache + uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 + + - name: Setup Nushell + uses: hustcer/setup-nu@v3 + with: + version: 0.79.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release Nu Binary + id: nu + run: nu .github/workflows/release-pkg.nu + env: + OS: ${{ matrix.os }} + REF: ${{ github.ref }} + TARGET: ${{ matrix.target }} + _EXTRA_: ${{ matrix.extra }} + TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }} + + - name: Create an Issue for Release Failure + if: ${{ failure() }} + uses: JasonEtco/create-an-issue@v2.9.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + update_existing: true + search_existing: open + filename: .github/ISSUE_TEMPLATE/nightly-build-fail.md diff --git a/README.md b/README.md index f06e3657fb..2bce62e569 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Nushell [![Crates.io](https://img.shields.io/crates/v/nu.svg)](https://crates.io/crates/nu) [![Build Status](https://img.shields.io/github/actions/workflow/status/nushell/nushell/ci.yml?branch=main)](https://github.com/nushell/nushell/actions) +[![Nightly Build](https://github.com/nushell/nushell/actions/workflows/nightly-build.yml/badge.svg)](https://github.com/nushell/nushell/actions/workflows/nightly-build.yml) [![Discord](https://img.shields.io/discord/601130461678272522.svg?logo=discord)](https://discord.gg/NtAbbGn) [![The Changelog #363](https://img.shields.io/badge/The%20Changelog-%23363-61c192.svg)](https://changelog.com/podcast/363) [![@nu_shell](https://img.shields.io/badge/twitter-@nu_shell-1DA1F3?style=flat-square)](https://twitter.com/nu_shell)