Skip to content

Commit

Permalink
Merge pull request #196 from Cray-HPE/latest-only-on-default-branch
Browse files Browse the repository at this point in the history
Latest only on default branch
  • Loading branch information
rustydb authored Dec 4, 2024
2 parents c39e056 + a476fac commit 055b0f9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/promote-prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# MIT License
#
# (C) Copyright 2023 Hewlett Packard Enterprise Development LP
# (C) Copyright 2023-2024 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -71,8 +71,8 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: '1.20' # The Go version to download (if necessary) and use.
# generate updated docs from any changes made to cani codebase

# generate updated docs from any changes made to cani codebase
- run: go run main.go makedocs

- name: Set up Python
Expand Down Expand Up @@ -102,4 +102,3 @@ jobs:
- name: list doc versions 🚀
run: |
mike list -F mkdocs.yml -b gh-pages
24 changes: 19 additions & 5 deletions .github/workflows/promote-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# MIT License
#
# (C) Copyright 2023 Hewlett Packard Enterprise Development LP
# (C) Copyright 2023-2024 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -30,6 +30,7 @@ on:
workflow_dispatch:
env:
STREAM: stable
LATEST: false
jobs:
Promote:
runs-on: ubuntu-latest
Expand All @@ -47,13 +48,26 @@ jobs:
with:
STREAM: ${{ env.STREAM }}

- name: Get Branch
run: |
mapfile -t branches < <(git branch -r --contains ${{ github.ref }} | awk '{print $1}')
echo "${branches[@]}"
for branch in "${branches[@]}"; do
branch_name="${branch/origin\/}"
echo "${branch_name}"
if [ "${branch_name}" = 'main' ]; then
echo LATEST=true >> $GITHUB_ENV
break
fi
done
- uses: ncipollo/release-action@v1
with:
allowUpdates: true # if the job is re-ran to catch missed artifacts, allow updates
generateReleaseNotes: false
artifacts: ${{ env.DIR_UPLOAD }}/*
prerelease: false
makeLatest: true
makeLatest: ${{ fromJSON(env.LATEST) }}

generate_publish_docs:
name: generate docs and publish with mike
Expand All @@ -66,8 +80,8 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: '1.20' # The Go version to download (if necessary) and use.
# generate updated docs from any changes made to cani codebase

# generate updated docs from any changes made to cani codebase
- run: go run main.go makedocs

- name: Set up Python
Expand All @@ -84,7 +98,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: generate hardware type docs
run: |
make generate-hardwaretypes-docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# MIT License
#
# (C) Copyright 2022-2023 Hewlett Packard Enterprise Development LP
# (C) Copyright 2022-2024 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: run shellcheck
uses: ludeeus/action-shellcheck@master
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/shellspec.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# MIT License
#
# (C) Copyright 2022-2023 Hewlett Packard Enterprise Development LP
# (C) Copyright 2022-2024 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -43,19 +43,19 @@ jobs:
repository: Cray-HPE/hms-simulation-environment
ref: v1
fetch-depth: 0

- name: checkout shellspec
uses: actions/checkout@v3
with:
path: shellspec
repository: shellspec/shellspec
fetch-depth: 0

- name: set up python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: install python dependencies
run: pip3 install -r requirements.txt

Expand Down

0 comments on commit 055b0f9

Please sign in to comment.