-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a8318a
commit a978f6e
Showing
7 changed files
with
292 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Auto Build Publish Test | ||
on: | ||
push: | ||
branches: | ||
- master | ||
# Triggers the workflow on labeled PRs only. | ||
pull_request_target: | ||
types: [ labeled ] | ||
# Ensures that only the latest commit is running for each PR at a time. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Auto-Build-Publish-Test: | ||
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || github.event_name == 'push' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu, windows, macos ] | ||
runs-on: ${{ matrix.os }}-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go with cache | ||
uses: jfrog/.github/actions/install-go-with-cache@main | ||
|
||
- name: Install local Artifactory | ||
uses: jfrog/.github/actions/install-local-artifactory@main | ||
with: | ||
RTLIC: ${{ secrets.RTLIC }} | ||
|
||
- name: Post Step to Test the Auto Build-Publish post step | ||
uses: gacts/run-and-post-run@v1 | ||
with: | ||
post: | | ||
jf c add --artifactory-url http://localhost:8081/artifactory --user admin --password password; \ | ||
count=$(jf rt search "artifactory-build-info/${GITHUB_WORKFLOW}/${GITHUB_RUN_NUMBER}-*" --count 2>stderr.log); \ | ||
exit_code=$?; \ | ||
cat stderr.log; \ | ||
if [ $exit_code -ne 0 ]; then \ | ||
echo "Command failed with exit code $exit_code."; \ | ||
exit 1; \ | ||
fi; \ | ||
if [ "$count" -eq 0 ]; then \ | ||
echo "No build info found."; \ | ||
exit 1; \ | ||
fi | ||
- name: Setup JFrog CLI | ||
id: setup-jfrog-cli | ||
uses: ./ | ||
env: | ||
JF_URL: http://localhost:8081/ | ||
JF_USER: admin | ||
JF_PASSWORD: password | ||
|
||
- name: Create NPM Remote Repository JSON | ||
uses: jsdaniell/[email protected] | ||
with: | ||
name: "npm-remote-template.json" | ||
json: '{ | ||
"key": "npm-remote", | ||
"rclass": "remote", | ||
"packageType": "npm", | ||
"url": "https://registry.npmjs.org" | ||
}' | ||
|
||
- name: Configure Artifactory NPM Remote Repository | ||
run: jf rt repo-create npm-remote-template.json | ||
shell: bash | ||
|
||
- name: Add npm modules to local build-info | ||
run: | | ||
jf npm-config --repo-resolve npm-remote | ||
jf npm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.