Skip to content

Commit b35688a

Browse files
authored
Merge pull request #16 from cortex-command-community/update-workflow-names
ci: rename workflows for better grouping/clarity
2 parents 0c87ec9 + c2d3f6e commit b35688a

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

.github/workflows/nightly.yaml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Nightly Development Build and Release
1+
name: Nightly (Development) Build and Release
22
# Controls when the action will run.
33
on:
44
workflow_dispatch:
@@ -19,33 +19,47 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
outputs:
22-
needs_build: ${{ steps.check_build.outputs.needs_build }}
22+
needs_build: ${{ steps.check_manual_run.outputs.needs_build || steps.check_tags.outputs.needs_build }}
2323

2424
steps:
25+
26+
- name: Check if workflow was manually triggered
27+
id: check_manual_run
28+
run: |
29+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
30+
echo "Workflow dispatched manually. Continuing..."
31+
echo "needs_build=true" >> $GITHUB_OUTPUT;
32+
else
33+
echo "Workflow triggered by a scheduled run. Continuing..."
34+
echo "needs_build=false" >> $GITHUB_OUTPUT;
35+
fi
36+
2537
- name: Checkout code
38+
if: !steps.check_manual_run.outputs.needs_build
2639
uses: actions/checkout@v3
2740

2841
- name: fetch tags
42+
if: !steps.check_manual_run.outputs.needs_build
2943
run: git fetch --tags origin
3044

3145
- name: Check if tags point to the same commit or if the workflow was manually triggered
32-
id: check_build
46+
if: !steps.check_manual_run.outputs.needs_build
47+
id: check_tags
3348
run: |
34-
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
35-
echo "Workflow dispatched manually. Continuing..."
49+
curr_sha=$(git rev-parse HEAD)
50+
prev_sha=$(git rev-parse ${{ env.PREV_TAG }} 2>/dev/null)
51+
52+
if [[ $? -ne 0 ]]; then
53+
echo "Tag ${{ env.PREV_TAG }} cannot be resolved. Continuing..."
3654
echo "needs_build=true" >> $GITHUB_OUTPUT;
55+
elif [[ "$curr_sha" == "$prev_sha" ]]; then
56+
echo "No changes since last nightly release. Exiting..."
57+
echo "needs_build=false" >> $GITHUB_OUTPUT;
3758
else
38-
curr_sha=$(git rev-parse HEAD)
39-
prev_sha=$(git rev-parse ${{ env.PREV_TAG }})
40-
41-
if [[ "$curr_sha" == "$prev_sha" ]]; then
42-
echo "No changes since last nightly release. Exiting..."
43-
echo "needs_build=false" >> $GITHUB_OUTPUT;
44-
else
45-
echo "Changes since last nightly release detected. Continuing..."
46-
echo "needs_build=true" >> $GITHUB_OUTPUT;
47-
fi
59+
echo "Changes since last nightly release detected. Continuing..."
60+
echo "needs_build=true" >> $GITHUB_OUTPUT;
4861
fi
62+
4963
5064
build-meson-releases:
5165
name: Linux & macOS Release Builds

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Release
1+
name: Master Build and Release
22
# Controls when the action will run.
33
on:
44
workflow_dispatch:

0 commit comments

Comments
 (0)