Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: jason yang <[email protected]>
  • Loading branch information
JasonYangShadow committed Dec 6, 2023
1 parent 8bd8174 commit 3f30ab8
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 92 deletions.
111 changes: 58 additions & 53 deletions .github/actions/generate/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,45 +49,45 @@ runs:
fi
shell: bash

- name: Build spec and dist
if: inputs.nightly == 'false' || inputs.nightly == 'true' && 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'
id: dist
run: |
dist="warewulf-${{ env.TAG }}.tar.gz"
if [[ ! -f "$dist" ]];then
for f in warewulf-*.tar.gz; do
if [[ -e "$f" ]]; then
dist="$f"
break
fi
done
fi
echo "DIST=$dist" >> $GITHUB_ENV
version=`echo $dist | sed 's/warewulf-//' | sed 's/\.tar\.gz//'`
echo "version=$version" >> $GITHUB_OUTPUT
shell: bash

- name: Upload warewulf.spec
if: inputs.nightly == 'false' || inputs.nightly == 'true' && 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'
uses: actions/upload-artifact@v3
with:
name: ${{ env.DIST }}
path: ${{ env.DIST }}
#- name: Build spec and dist
# if: inputs.nightly == 'false' || inputs.nightly == 'true' && 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'
# id: dist
# run: |
# dist="warewulf-${{ env.TAG }}.tar.gz"

# if [[ ! -f "$dist" ]];then
# for f in warewulf-*.tar.gz; do
# if [[ -e "$f" ]]; then
# dist="$f"
# break
# fi
# done
# fi
# echo "DIST=$dist" >> $GITHUB_ENV

# version=`echo $dist | sed 's/warewulf-//' | sed 's/\.tar\.gz//'`
# echo "version=$version" >> $GITHUB_OUTPUT
# shell: bash

#- name: Upload warewulf.spec
# if: inputs.nightly == 'false' || inputs.nightly == 'true' && 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'
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.DIST }}
# path: ${{ env.DIST }}

- name: Normal dist release
uses: xresloader/upload-to-github-release@v1
Expand All @@ -112,18 +112,23 @@ runs:
EOF
shell: bash

- name: Nightly dist release
uses: xresloader/upload-to-github-release@v1
if: inputs.nightly == 'true' && steps.should-continue.outputs.continue == 'true'
id: release
with:
release_id: ${{ inputs.event-id }}
file: ${{ env.DIST }}
tag_name: "nightly"
prerelease: true
draft: false
default_release_name: "warewulf nightly release"
default_release_body_path: nightly.release.note
update_latest_release: true
overwrite: true
- name: test
run: |
cat nightly.release.note
shell: bash

#- name: Nightly dist release
# uses: xresloader/upload-to-github-release@v1
# if: inputs.nightly == 'true' && steps.should-continue.outputs.continue == 'true'
# id: release
# with:
# release_id: ${{ inputs.event-id }}
# file: ${{ env.DIST }}
# tag_name: "nightly"
# prerelease: true
# draft: false
# default_release_name: "warewulf nightly release"
# default_release_body_path: nightly.release.note
# update_latest_release: true
# overwrite: true

78 changes: 39 additions & 39 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,43 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
event-id: ${{ github.event.release.id }}

publish:
name: Build and publish releases
runs-on: ubuntu-latest
needs: generate
if: needs.generate.outputs.should-continue == 'true'
container:
image: rockylinux/rockylinux:9
options: --privileged
strategy:
fail-fast: false
matrix:
include:
- target: rocky+epel-8-x86_64
arch: x86_64
dist: el8
- target: rocky+epel-9-x86_64
arch: x86_64
dist: el9
- target: centos+epel-7-x86_64
arch: x86_64
dist: el7
- target: opensuse-leap-15.5-x86_64
arch: x86_64
dist: suse.lp155
permissions: write-all # might not be used for realy deployment
#publish:
# name: Build and publish releases
# runs-on: ubuntu-latest
# needs: generate
# if: needs.generate.outputs.should-continue == 'true'
# container:
# image: rockylinux/rockylinux:9
# options: --privileged
# strategy:
# fail-fast: false
# matrix:
# include:
# - target: rocky+epel-8-x86_64
# arch: x86_64
# dist: el8
# - target: rocky+epel-9-x86_64
# arch: x86_64
# dist: el9
# - target: centos+epel-7-x86_64
# arch: x86_64
# dist: el7
# - target: opensuse-leap-15.5-x86_64
# arch: x86_64
# dist: suse.lp155
# permissions: write-all # might not be used for realy deployment

steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: ./.github/actions/rpm
name: build rpms
id: rpm
with:
dist: ${{ matrix.dist }}
arch: ${{ matrix.arch }}
target: ${{ matrix.target }}
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ needs.generate.outputs.version }}
event-id: ${{ needs.generate.outputs.release-id }}
nightly: 'true'
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# - uses: ./.github/actions/rpm
# name: build rpms
# id: rpm
# with:
# dist: ${{ matrix.dist }}
# arch: ${{ matrix.arch }}
# target: ${{ matrix.target }}
# token: ${{ secrets.GITHUB_TOKEN }}
# version: ${{ needs.generate.outputs.version }}
# event-id: ${{ needs.generate.outputs.release-id }}
# nightly: 'true'

0 comments on commit 3f30ab8

Please sign in to comment.