-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add workflows for the migration to Artifactory #971
base: main
Are you sure you want to change the base?
Changes from all commits
0692436
4380f76
7aad4b3
19b8bec
4a009dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build App | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
type: string | ||
force_pack: | ||
type: boolean | ||
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wondering where the comes from (at least I couldn't see it being passed in the workflow using this in RSSI) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is used in the release workflow: https://github.com/NordicSemiconductor/pc-nrfconnect-shared/blob/artifactory/github_actions/.github/workflows/release-app.yml#L20 |
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 22 | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run check | ||
- run: npm test | ||
- run: npm run build:prod | ||
- run: npm pack | ||
if: | ||
github.event.push.ref == 'refs/heads/main' || | ||
inputs.force_pack | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./*.tgz | ||
if: | ||
github.event.push.ref == 'refs/heads/main' || | ||
inputs.force_pack |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,60 @@ | ||
name: Check labels | ||
|
||
on: | ||
workflow_call: | ||
on: workflow_call | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
jobs: | ||
check_label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Check for missing doc label' | ||
if: > | ||
! contains(github.event.pull_request.labels.*.name, 'doc required') && | ||
! contains(github.event.pull_request.labels.*.name, 'doc not required') | ||
run: echo "missing_doc_label=true" >> "$GITHUB_ENV" | ||
- name: 'Check for missing doc label' | ||
if: > | ||
! contains(github.event.pull_request.labels.*.name, 'doc required') && | ||
! contains(github.event.pull_request.labels.*.name, 'doc not required') | ||
run: echo "missing_doc_label=true" >> "$GITHUB_ENV" | ||
|
||
- name: 'Check for missing ui label' | ||
if: > | ||
! contains(github.event.pull_request.labels.*.name, 'ui required') && | ||
! contains(github.event.pull_request.labels.*.name, 'ui not required') | ||
run: echo "missing_ui_label=true" >> "$GITHUB_ENV" | ||
|
||
- name: 'Notify user if label(s) is missing' | ||
if: > | ||
(env.missing_doc_label == 'true' || | ||
env.missing_ui_label == 'true') && | ||
! contains(github.event.pull_request.labels.*.name, 'documentation') | ||
run: | | ||
URL="${{ github.event.pull_request.html_url }}" | ||
TAG_IDENTIFIER="<!--labels-->" | ||
COMMENT_TEXT="${TAG_IDENTIFIER}\nAdd labels:" | ||
if [[ "${{ env.missing_doc_label }}" == 'true' ]]; then | ||
COMMENT_TEXT="${COMMENT_TEXT}\n- 'doc required' or 'doc not required'" | ||
fi | ||
if [[ "${{ env.missing_ui_label }}" == 'true' ]]; then | ||
COMMENT_TEXT="${COMMENT_TEXT}\n | ||
- 'ui required' or 'ui not required'\n\n | ||
For UI review:\n | ||
- describe the changes\n | ||
- add pictures\n | ||
- add the relevant UI responsible(s) as a reviewer" | ||
fi | ||
- name: 'Check for missing ui label' | ||
if: > | ||
! contains(github.event.pull_request.labels.*.name, 'ui required') && | ||
! contains(github.event.pull_request.labels.*.name, 'ui not required') | ||
run: echo "missing_ui_label=true" >> "$GITHUB_ENV" | ||
|
||
if [[ ! \ | ||
$(gh pr view $URL \ | ||
--json comments \ | ||
--jq '.comments[].body | select(. | startswith("'"$TAG_IDENTIFIER"'"))') \ | ||
]]; then | ||
gh pr comment $URL --body "$(echo -e $COMMENT_TEXT)" | ||
fi | ||
- name: 'Notify user if label(s) is missing' | ||
if: > | ||
(env.missing_doc_label == 'true' || | ||
env.missing_ui_label == 'true') && | ||
! contains(github.event.pull_request.labels.*.name, 'documentation') | ||
run: | | ||
URL="${{ github.event.pull_request.html_url }}" | ||
TAG_IDENTIFIER="<!--labels-->" | ||
COMMENT_TEXT="${TAG_IDENTIFIER}\nAdd labels:" | ||
if [[ "${{ env.missing_doc_label }}" == 'true' ]]; then | ||
COMMENT_TEXT="${COMMENT_TEXT}\n- 'doc required' or 'doc not required'" | ||
fi | ||
if [[ "${{ env.missing_ui_label }}" == 'true' ]]; then | ||
COMMENT_TEXT="${COMMENT_TEXT}\n | ||
- 'ui required' or 'ui not required'\n\n | ||
For UI review:\n | ||
- describe the changes\n | ||
- add pictures\n | ||
- add the relevant UI responsible(s) as a reviewer" | ||
fi | ||
|
||
- name: 'Fail' | ||
uses: actions/github-script@v7 | ||
if: > | ||
(env.missing_doc_label == 'true' || | ||
env.missing_ui_label == 'true') && | ||
! contains(github.event.pull_request.labels.*.name, 'documentation') | ||
with: | ||
script: core.setFailed('Required doc and/or ui labels missing.') | ||
if [[ ! \ | ||
$(gh pr view $URL \ | ||
--json comments \ | ||
--jq '.comments[].body | select(. | startswith("'"$TAG_IDENTIFIER"'"))') \ | ||
]]; then | ||
gh pr comment $URL --body "$(echo -e $COMMENT_TEXT)" | ||
fi | ||
|
||
- name: 'Fail' | ||
uses: actions/github-script@v7 | ||
if: > | ||
(env.missing_doc_label == 'true' || | ||
env.missing_ui_label == 'true') && | ||
! contains(github.event.pull_request.labels.*.name, 'documentation') | ||
with: | ||
script: core.setFailed('Required doc and/or ui labels missing.') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
type: string | ||
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the other comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here the reasoning is similar: When releasing the latest commit to the |
||
source: | ||
required: true | ||
type: string | ||
access_level: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-app.yml | ||
with: | ||
ref: ${{ inputs.ref }} | ||
force_pack: true | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
environment: | ||
name: ${{ inputs.source }} | ||
|
||
steps: | ||
- uses: actions/download-artifact@v4 | ||
- env: | ||
ARTIFACTORY_TOKEN: | ||
${{ secrets.COM_NORDICSEMI_FILES_USERNAME }} | ||
run: | | ||
cd artifact | ||
tar xaf *.tgz --strip-components 1 | ||
node dist/nordic-publish.js \ | ||
--no-pack \ | ||
--destination artifactory \ | ||
--access-level ${{ inputs.access_level }} \ | ||
--source ${{ inputs.source }} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Test shared | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 22 | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run check | ||
- run: npm test | ||
- run: npm pack | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is packing necessary here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not really necessary, but I try to do as many steps towards releasing without actually releasing to check whether anything might go wrong if we want to release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to not make this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the build workflow the default is always correct. For the release workflow the default will be correct most of the time. So we only need to override occasionally.