-
Notifications
You must be signed in to change notification settings - Fork 552
79 lines (70 loc) · 2.38 KB
/
release-nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Release nightly
on:
schedule:
- cron: "0 0 * * *" # every day at midnight
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check-latest-run:
runs-on: "ubuntu-latest"
steps:
- uses: octokit/[email protected]
id: check_last_run
with:
route: GET /repos/${{github.repository}}/actions/workflows/release-nightly.yml/runs?per_page=1&status=completed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
last_sha: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha }}
release-nightly:
if: needs.check-latest-run.outputs.last_sha != github.sha
runs-on: ubuntu-latest
needs: [check-latest-run]
env:
working-directory: go/src/github.com/ignite/cli
steps:
- uses: actions/checkout@v4
- name: Delete the nightly release
uses: dev-drprasad/[email protected]
with:
tag_name: nightly
delete_release: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push new nightly tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: nightly
tag_prefix: ""
- name: Create the new nightly release
uses: ncipollo/release-action@v1
with:
tag: nightly
name: nightly
body: "Install and move the CLI to your bin directory: `curl https://get.ignite.com/cli@nightly! | bash`"
prerelease: true
releases-binaries:
if: needs.check-latest-run.outputs.last_sha != github.sha
name: Release Go Binary
needs: [check-latest-run]
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
project_path: "./ignite/cmd/ignite"
binary_name: "ignite"
asset_name: ignite-nightly-${{ matrix.goos }}-${{ matrix.goarch }}
release_name: "nightly"
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
ldflags: -s -w -X github.com/ignite/cli/v29/ignite/version.Version=nightly
retry: 10