forked from warewulf/warewulf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: xu yang <[email protected]>
- Loading branch information
1 parent
6a9e161
commit aa4864f
Showing
3 changed files
with
26 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,6 @@ name: 'Generate warewulf metadata' | |
description: 'Generate warewulf.spec and dist, collect commits info' | ||
|
||
inputs: | ||
nightly: | ||
description: "Whether it is nightly release" | ||
required: true | ||
default: 'false' | ||
token: | ||
description: "Github token" | ||
required: true | ||
|
@@ -29,14 +25,15 @@ runs: | |
steps: | ||
- name: Extract current branch tag | ||
run: | | ||
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
echo "BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
echo "TAG=`./script/get-version.sh`" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Extract last 24 hours commits info | ||
id: commits | ||
run: | | ||
echo "raw=`git reflog ${{ env.TAG }} --since="24 hours ago"`" >> $GITHUB_OUTPUT | ||
echo "commits=`git log ${{ env.TAG }} --pretty --since="24 hours ago" | jq --raw-input . | jq --slurp . | jq -c .`" >> $GITHUB_OUTPUT | ||
echo "raw=`git reflog ${{ env.BRANCH }} --since="24 hours ago"`" >> $GITHUB_OUTPUT | ||
echo "commits=`git log ${{ env.BRANCH }} --pretty --since="24 hours ago" | jq --raw-input . | jq --slurp . | jq -c .`" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Whether should continue | ||
|
@@ -50,13 +47,13 @@ runs: | |
shell: bash | ||
|
||
- name: Build spec and dist | ||
if: inputs.nightly == 'false' || inputs.nightly == 'true' && steps.should-continue.outputs.continue == 'true' | ||
if: steps.should-continue.outputs.continue == 'true' | ||
run: | | ||
make warewulf.spec dist | ||
shell: bash | ||
|
||
- name: Set DIST | ||
if: inputs.nightly == 'false' || inputs.nightly == 'true' && steps.should-continue.outputs.continue == 'true' | ||
if: steps.should-continue.outputs.continue == 'true' | ||
id: dist | ||
run: | | ||
dist="warewulf-${{ env.TAG }}.tar.gz" | ||
|
@@ -76,30 +73,21 @@ runs: | |
shell: bash | ||
|
||
- name: Upload warewulf.spec | ||
if: inputs.nightly == 'false' || inputs.nightly == 'true' && steps.should-continue.outputs.continue == 'true' | ||
if: steps.should-continue.outputs.continue == 'true' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: warewulf.spec | ||
path: warewulf.spec | ||
|
||
- name: Upload DIST | ||
if: inputs.nightly == 'false' || inputs.nightly == 'true' && steps.should-continue.outputs.continue == 'true' | ||
if: steps.should-continue.outputs.continue == 'true' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.DIST }} | ||
path: ${{ env.DIST }} | ||
|
||
- name: Normal dist release | ||
uses: xresloader/upload-to-github-release@v1 | ||
if: inputs.nightly == 'false' | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.token }} | ||
with: | ||
release_id: ${{ inputs.event-id }} | ||
file: ${{ env.DIST }} | ||
|
||
- name: Write nightly release content | ||
if: inputs.nightly == 'true' && steps.should-continue.outputs.continue == 'true' | ||
if: steps.should-continue.outputs.continue == 'true' | ||
run: | | ||
cat << EOF >> nightly.release.note | ||
THIS IS A NIGHTLY RELEASE | ||
|
@@ -116,7 +104,7 @@ runs: | |
|
||
- name: Nightly dist release | ||
uses: xresloader/upload-to-github-release@v1 | ||
if: inputs.nightly == 'true' && steps.should-continue.outputs.continue == 'true' | ||
if: steps.should-continue.outputs.continue == 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.token }} | ||
with: | ||
|
@@ -129,7 +117,7 @@ runs: | |
default_release_name: "warewulf nightly release" | ||
|
||
- name: Update nightly release content | ||
if: inputs.nightly == 'true' && steps.should-continue.outputs.continue == 'true' | ||
if: steps.should-continue.outputs.continue == 'true' | ||
uses: tubone24/[email protected] | ||
id: release | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters