Skip to content

Commit b4b0d4f

Browse files
committed
Some small tweaks to nightly release workflow
1 parent a9b467a commit b4b0d4f

File tree

1 file changed

+112
-123
lines changed

1 file changed

+112
-123
lines changed

.github/workflows/nightly-build.yml

Lines changed: 112 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ name: Nightly Build
1010
on:
1111
push:
1212
branches:
13-
- nightly # Just for test purpose only with the nightly repo
13+
- nightly # Just for test purpose only with the nightly repo
1414
# This schedule will run only from the default branch
1515
schedule:
16-
- cron: "15 0 * * *" # run at 00:15 AM UTC
16+
- cron: '15 0 * * *' # run at 00:15 AM UTC
1717

1818
defaults:
1919
run:
@@ -27,7 +27,7 @@ jobs:
2727
# if: github.repository == 'nushell/nightly'
2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@v4.1.7
30+
uses: actions/checkout@v4
3131
if: github.repository == 'nushell/nightly'
3232
with:
3333
ref: main
@@ -36,10 +36,10 @@ jobs:
3636
token: ${{ secrets.WORKFLOW_TOKEN }}
3737

3838
- name: Setup Nushell
39-
uses: hustcer/setup-nu@v3.13
39+
uses: hustcer/setup-nu@v3
4040
if: github.repository == 'nushell/nightly'
4141
with:
42-
version: 0.97.1
42+
version: 0.98.0
4343

4444
# Synchronize the main branch of nightly repo with the main branch of Nushell official repo
4545
- name: Prepare for Nightly Release
@@ -65,131 +65,120 @@ jobs:
6565
}
6666
6767
standard:
68-
name: Std
68+
name: Nu
6969
needs: prepare
7070
strategy:
7171
fail-fast: false
7272
matrix:
7373
target:
74-
- aarch64-apple-darwin
75-
- x86_64-apple-darwin
76-
- x86_64-pc-windows-msvc
77-
- aarch64-pc-windows-msvc
78-
- x86_64-unknown-linux-gnu
79-
- x86_64-unknown-linux-musl
80-
- aarch64-unknown-linux-gnu
81-
- aarch64-unknown-linux-musl
82-
- armv7-unknown-linux-gnueabihf
83-
- armv7-unknown-linux-musleabihf
84-
- riscv64gc-unknown-linux-gnu
85-
extra: ["bin"]
74+
- aarch64-apple-darwin
75+
- x86_64-apple-darwin
76+
- x86_64-pc-windows-msvc
77+
- aarch64-pc-windows-msvc
78+
- x86_64-unknown-linux-gnu
79+
- x86_64-unknown-linux-musl
80+
- aarch64-unknown-linux-gnu
81+
- aarch64-unknown-linux-musl
82+
- armv7-unknown-linux-gnueabihf
83+
- armv7-unknown-linux-musleabihf
84+
- riscv64gc-unknown-linux-gnu
85+
- loongarch64-unknown-linux-gnu
86+
extra: ['bin']
8687
include:
87-
- target: aarch64-apple-darwin
88-
os: macos-latest
89-
target_rustflags: ""
90-
- target: x86_64-apple-darwin
91-
os: macos-latest
92-
target_rustflags: ""
93-
- target: x86_64-pc-windows-msvc
94-
extra: "bin"
95-
os: windows-latest
96-
target_rustflags: ""
97-
- target: x86_64-pc-windows-msvc
98-
extra: msi
99-
os: windows-latest
100-
target_rustflags: ""
101-
- target: aarch64-pc-windows-msvc
102-
extra: "bin"
103-
os: windows-latest
104-
target_rustflags: ""
105-
- target: aarch64-pc-windows-msvc
106-
extra: msi
107-
os: windows-latest
108-
target_rustflags: ""
109-
- target: x86_64-unknown-linux-gnu
110-
os: ubuntu-22.04
111-
target_rustflags: ""
112-
- target: x86_64-unknown-linux-musl
113-
os: ubuntu-22.04
114-
target_rustflags: ""
115-
- target: aarch64-unknown-linux-gnu
116-
os: ubuntu-22.04
117-
target_rustflags: ""
118-
- target: aarch64-unknown-linux-musl
119-
os: ubuntu-22.04
120-
target_rustflags: ""
121-
- target: armv7-unknown-linux-gnueabihf
122-
os: ubuntu-22.04
123-
target_rustflags: ""
124-
- target: armv7-unknown-linux-musleabihf
125-
os: ubuntu-22.04
126-
target_rustflags: ""
127-
- target: riscv64gc-unknown-linux-gnu
128-
os: ubuntu-latest
129-
target_rustflags: ""
88+
- target: aarch64-apple-darwin
89+
os: macos-latest
90+
- target: x86_64-apple-darwin
91+
os: macos-latest
92+
- target: x86_64-pc-windows-msvc
93+
extra: 'bin'
94+
os: windows-latest
95+
- target: x86_64-pc-windows-msvc
96+
extra: msi
97+
os: windows-latest
98+
- target: aarch64-pc-windows-msvc
99+
extra: 'bin'
100+
os: windows-latest
101+
- target: aarch64-pc-windows-msvc
102+
extra: msi
103+
os: windows-latest
104+
- target: x86_64-unknown-linux-gnu
105+
os: ubuntu-22.04
106+
- target: x86_64-unknown-linux-musl
107+
os: ubuntu-22.04
108+
- target: aarch64-unknown-linux-gnu
109+
os: ubuntu-22.04
110+
- target: aarch64-unknown-linux-musl
111+
os: ubuntu-22.04
112+
- target: armv7-unknown-linux-gnueabihf
113+
os: ubuntu-22.04
114+
- target: armv7-unknown-linux-musleabihf
115+
os: ubuntu-22.04
116+
- target: riscv64gc-unknown-linux-gnu
117+
os: ubuntu-latest
118+
- target: loongarch64-unknown-linux-gnu
119+
os: ubuntu-22.04
130120

131121
runs-on: ${{matrix.os}}
132122

133123
steps:
134-
- uses: actions/[email protected]
135-
with:
136-
ref: main
137-
fetch-depth: 0
138-
139-
- name: Update Rust Toolchain Target
140-
run: |
141-
echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml
142-
143-
- name: Setup Rust toolchain and cache
144-
uses: actions-rust-lang/[email protected]
145-
# WARN: Keep the rustflags to prevent from the winget submission error: `CAQuietExec: Error 0xc0000135`
146-
with:
147-
rustflags: ""
148-
149-
- name: Setup Nushell
150-
uses: hustcer/[email protected]
151-
with:
152-
version: 0.97.1
153-
154-
- name: Release Nu Binary
155-
id: nu
156-
run: nu .github/workflows/release-pkg.nu
157-
env:
158-
OS: ${{ matrix.os }}
159-
REF: ${{ github.ref }}
160-
TARGET: ${{ matrix.target }}
161-
_EXTRA_: ${{ matrix.extra }}
162-
TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }}
163-
164-
- name: Create an Issue for Release Failure
165-
if: ${{ failure() }}
166-
uses: JasonEtco/[email protected]
167-
env:
168-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
169-
with:
170-
update_existing: true
171-
search_existing: open
172-
filename: .github/AUTO_ISSUE_TEMPLATE/nightly-build-fail.md
173-
174-
- name: Set Outputs of Short SHA
175-
id: vars
176-
run: |
177-
echo "date=$(date -u +'%Y-%m-%d')" >> $GITHUB_OUTPUT
178-
sha_short=$(git rev-parse --short HEAD)
179-
echo "sha_short=${sha_short:0:7}" >> $GITHUB_OUTPUT
180-
181-
# REF: https://github.com/marketplace/actions/gh-release
182-
# Create a release only in nushell/nightly repo
183-
- name: Publish Archive
184-
uses: softprops/[email protected]
185-
if: ${{ startsWith(github.repository, 'nushell/nightly') }}
186-
with:
187-
prerelease: true
188-
files: ${{ steps.nu.outputs.archive }}
189-
tag_name: nightly-${{ steps.vars.outputs.sha_short }}
190-
name: Nu-nightly-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.sha_short }}
191-
env:
192-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
- uses: actions/checkout@v4
125+
with:
126+
ref: main
127+
fetch-depth: 0
128+
129+
- name: Update Rust Toolchain Target
130+
run: |
131+
echo "targets = ['${{matrix.target}}']" >> rust-toolchain.toml
132+
133+
- name: Setup Rust toolchain and cache
134+
uses: actions-rust-lang/[email protected]
135+
# WARN: Keep the rustflags to prevent from the winget submission error: `CAQuietExec: Error 0xc0000135`
136+
with:
137+
rustflags: ''
138+
139+
- name: Setup Nushell
140+
uses: hustcer/setup-nu@v3
141+
with:
142+
version: 0.98.0
143+
144+
- name: Release Nu Binary
145+
id: nu
146+
run: nu .github/workflows/release-pkg.nu
147+
env:
148+
OS: ${{ matrix.os }}
149+
REF: ${{ github.ref }}
150+
TARGET: ${{ matrix.target }}
151+
_EXTRA_: ${{ matrix.extra }}
152+
153+
- name: Create an Issue for Release Failure
154+
if: ${{ failure() }}
155+
uses: JasonEtco/[email protected]
156+
env:
157+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
158+
with:
159+
update_existing: true
160+
search_existing: open
161+
filename: .github/AUTO_ISSUE_TEMPLATE/nightly-build-fail.md
162+
163+
- name: Set Outputs of Short SHA
164+
id: vars
165+
run: |
166+
echo "date=$(date -u +'%Y-%m-%d')" >> $GITHUB_OUTPUT
167+
sha_short=$(git rev-parse --short HEAD)
168+
echo "sha_short=${sha_short:0:7}" >> $GITHUB_OUTPUT
169+
170+
# REF: https://github.com/marketplace/actions/gh-release
171+
# Create a release only in nushell/nightly repo
172+
- name: Publish Archive
173+
uses: softprops/[email protected]
174+
if: ${{ startsWith(github.repository, 'nushell/nightly') }}
175+
with:
176+
prerelease: true
177+
files: ${{ steps.nu.outputs.archive }}
178+
tag_name: nightly-${{ steps.vars.outputs.sha_short }}
179+
name: Nu-nightly-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.sha_short }}
180+
env:
181+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
193182

194183
cleanup:
195184
name: Cleanup
@@ -201,14 +190,14 @@ jobs:
201190
- name: Waiting for Release
202191
run: sleep 1800
203192

204-
- uses: actions/checkout@v4.1.7
193+
- uses: actions/checkout@v4
205194
with:
206195
ref: main
207196

208197
- name: Setup Nushell
209-
uses: hustcer/setup-nu@v3.13
198+
uses: hustcer/setup-nu@v3
210199
with:
211-
version: 0.97.1
200+
version: 0.98.0
212201

213202
# Keep the last a few releases
214203
- name: Delete Older Releases

0 commit comments

Comments
 (0)