-
Notifications
You must be signed in to change notification settings - Fork 2
ci(PI-4819): keep binary updated #17
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6b391c6
ci:(PI-4819): add binary release checker, unpublishing step
4c9028d
commit should happen after staging
96d8930
change to publish the dev extension on each PR commit
a9374fc
fix typo
8642260
move file to correct location
0116ce0
use GITHUB_TOKEN, set cron schedule weekly
27661e3
configure git user
932b73b
handle extracting artifacts
2714cd6
fix typo
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,59 @@ | ||
| name: Update Binary | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| # Mon at 5am weekly | ||
| - cron: "00 5 * * 0" | ||
|
|
||
| jobs: | ||
| update-binary: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Get Latest Release | ||
| working-directory: ./nowsecure/bin | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| LATEST_VERSION=$(gh release --repo nowsecure/nowsecure-ci view --json tagName --jq '.tagName') | ||
| CURRENT_VERSION=$(cat version) | ||
|
|
||
| if [ "$LATEST_VERSION" = "$CURRENT_VERSION" ]; then | ||
| echo "Current version ($CURRENT_VERSION) is latest" | ||
| else | ||
| echo "$LATEST_VERSION" > version | ||
|
|
||
| find . -name 'ns_*' -delete | ||
|
|
||
| gh release --repo nowsecure/nowsecureci download --clobber \ | ||
| --pattern 'ns_darwin-arm64*' \ | ||
| --pattern 'ns_linux-amd64*' \ | ||
| --pattern 'ns_windows-amd64*' | ||
|
|
||
| # Github release has tgz and zip files, each containing license and readme files | ||
| find . -name '*.tgz' -exec tar -xzf {} \; | ||
| find . -name '*.zip' -exec unzip {} \; | ||
| rm LICENSE README.md | ||
|
|
||
| echo "RELEASE_NOTES=$(gh release --repo nowsecure/nowsecure-ci view --json body --jq '.body')" >> "$GITHUB_ENV" | ||
| fi | ||
|
|
||
| echo "LATEST_VERSION=$LATEST_VERSION" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Commit changes | ||
| working-directory: ./nowsecure/bin | ||
| run: | | ||
| PR_TITLE="chore(deps): update nowsecure-ci binary to ${{ env.LATEST_VERSION }}" | ||
| BRANCH_NAME="chore/ns-binary/${{ env.LATEST_VERSION }}" | ||
|
|
||
| git config --global user.email "devops@nowsecure.com" | ||
| git config --global user.name "Nora The Narwhal" | ||
|
|
||
| if [[ -n "$(git status --porcelain)" ]]; then | ||
| git checkout -b "$BRANCH_NAME" | ||
| git add . | ||
| git commit -m "$PR_TITLE" | ||
| git push | ||
| gh pr create --title "$PR_TITLE" --body "# NowSecure CI Release Notes \n ${{ env.RELEASE_NOTES }}" | ||
| fi |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "id": "dev-nowsecure-azure-ci-extension", | ||
| "name": "dev-nowsecure-azure-ci-extension", | ||
| "name": "DEV NowSecure Azure CI Extension", | ||
| "public": false, | ||
| "publisher": "qa-nowsecure" | ||
| } |
This file contains hidden or 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 @@ | ||
| v0.1.2 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.