Skip to content

Commit 3ce9d57

Browse files
committed
Update GHAs to shared workflows
This also fixes the branch name for "main.yml" to master. Signed-off-by: Eric Ball <eball@linuxfoundation.org>
1 parent 3ff1a58 commit 3ce9d57

File tree

2 files changed

+17
-125
lines changed

2 files changed

+17
-125
lines changed
Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ name: Main workflow
66
on:
77
pull_request:
88
branches:
9-
- main
9+
- master
1010
push:
1111
branches:
12-
- main
12+
- master
1313

1414
jobs:
1515
doc8:
@@ -49,19 +49,7 @@ jobs:
4949
- run: make linkcheck
5050

5151
license-check:
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v4
55-
56-
- name: reuse lint
57-
uses: fsfe/reuse-action@v4
52+
uses: onosproject/.github/.github/workflows/license-check.yml@main
5853

5954
fossa-check:
60-
runs-on: ubuntu-latest
61-
steps:
62-
- uses: actions/checkout@v4
63-
64-
- name: FOSSA scan
65-
uses: fossa-contrib/fossa-action@v3
66-
with:
67-
fossa-api-key: 0c3bbcdf20e157bbd487dae173751b28
55+
uses: onosproject/.github/.github/workflows/fossa-scan.yml@main

.github/workflows/publish.yml

Lines changed: 13 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -9,122 +9,26 @@ on:
99
- master
1010
workflow_dispatch:
1111

12-
1312
jobs:
14-
# NOTE: Action to tag repo, publish images/documents only enabled for "onosproject"
13+
# NOTE: Action to tag repo, publish documents only enabled for "onosproject"
1514
# CAUTION: Other actions depend on this name "tag-github"
1615
tag-github:
17-
runs-on: ubuntu-latest
18-
if: github.repository_owner == 'onosproject'
19-
outputs:
20-
changed: ${{ steps.version-change.outputs.changed }}
21-
version: ${{ steps.version-change.outputs.version }}
22-
steps:
23-
- uses: actions/checkout@v4
24-
with:
25-
fetch-depth: 0
26-
27-
- name: Get changes
28-
id: version-file
29-
run: |
30-
if git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep VERSION; then
31-
echo "changed=true" >> $GITHUB_OUTPUT
32-
else
33-
echo "VERSION file was not changed"
34-
fi
35-
36-
- name: Validate change in version file
37-
id: version-change
38-
if: steps.version-file.outputs.changed == 'true'
39-
run: |
40-
version=$(cat VERSION)
41-
echo "version=$version"
42-
validate="^[0-9]+\.[0-9]+\.[0-9]+$"
43-
if [[ $version =~ $validate ]]; then
44-
echo "changed=true" >> $GITHUB_OUTPUT
45-
echo "version=$version" >> $GITHUB_OUTPUT
46-
else
47-
echo "Version change not for release"
48-
fi
49-
50-
- name: Create release using REST API
51-
if: steps.version-change.outputs.changed == 'true'
52-
run: |
53-
curl -L \
54-
-X POST \
55-
-H "Accept: application/vnd.github+json" \
56-
-H "Authorization: Bearer ${{ secrets.GH_ONOS_PAT }}" \
57-
-H "X-GitHub-Api-Version: 2022-11-28" \
58-
https://api.github.com/repos/${{ github.repository }}/releases \
59-
-d '{
60-
"tag_name": "v${{ steps.version-change.outputs.version }}",
61-
"target_commitish": "${{ github.event.repository.default_branch }}",
62-
"name": "v${{ steps.version-change.outputs.version }}",
63-
"draft": false,
64-
"prerelease": false,
65-
"generate_release_notes": true
66-
}'
16+
uses: onosproject/.github/.github/workflows/tag-github.yml@main
17+
secrets: inherit
6718

6819
update-version:
69-
runs-on: ubuntu-latest
7020
needs: tag-github
7121
if: needs.tag-github.outputs.changed == 'true'
72-
steps:
73-
- uses: actions/checkout@v4
74-
75-
- name: Increment version
76-
run: |
77-
version=${{ needs.tag-github.outputs.version }}
78-
IFS='.' read -r major minor patch <<< "$version"
79-
minor_update=$((minor+1))
80-
NEW_VERSION="$major.$minor_update.$patch-dev"
81-
echo $NEW_VERSION > VERSION
82-
echo "Updated version: $NEW_VERSION"
83-
84-
- name: Create Pull Request
85-
uses: peter-evans/create-pull-request@v7
86-
with:
87-
token: ${{ secrets.GH_ONOS_PAT }}
88-
commit-message: Update version
89-
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
90-
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
91-
signoff: true
92-
branch: version-update
93-
delete-branch: true
94-
title: Update version
95-
body: |
96-
Update VERSION file
97-
add-paths: |
98-
VERSION
22+
uses: onosproject/.github/.github/workflows/bump-version.yml@main
23+
secrets: inherit
24+
with:
25+
version: ${{ needs.tag-github.outputs.version }}
9926

10027
publish:
101-
runs-on: ubuntu-latest
28+
needs: tag-github
10229
if: github.repository_owner == 'onosproject'
103-
env:
104-
BUILD_OUTPUT_PATH: _build/multiversion/
105-
steps:
106-
- uses: actions/checkout@v4
107-
with:
108-
fetch-depth: 0
109-
110-
- name: Set up Python
111-
uses: actions/setup-python@v5
112-
with:
113-
python-version: 3.11
114-
115-
- name: Build docs
116-
run: make multiversion
117-
118-
- name: List built files
119-
run: ls $BUILD_OUTPUT_PATH*
120-
121-
- name: rsync deployments
122-
uses: burnett01/rsync-deployments@7.0.1
123-
with:
124-
switches: -rvzh --delete-after --exclude=.git
125-
path: $BUILD_OUTPUT_PATH
126-
remote_path: /srv/sites/docs.sd-ran.org/
127-
remote_host: static.opennetworking.org
128-
remote_user: ${{ secrets.JENKINS_USERNAME }}
129-
remote_key: ${{ secrets.JENKINS_SSHKEY }}
130-
remote_key_pass: ${{ secrets.JENKINS_PASSPHRASE }}
30+
uses: onosproject/.github/.github/workflows/docs-publish.yml@main
31+
with:
32+
remote_host: static.opennetworking.org
33+
remote_path: /srv/sites/docs.sd-ran.org/
34+
secrets: inherit

0 commit comments

Comments
 (0)