Skip to content
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

Quickly test the released binaries and perform the release #94

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Test and Release

on:
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Hub Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PAT }}
- name: Prepare scout binary
run: |
tar -xf dist/docker-scout_*_linux_amd64.tar.gz -C .
chmod +x docker-scout
- name: TEST docker scout version
run: ./docker-scout version
- name: TEST docker scout quickview
run: ./docker-scout quickview alpine:latest
- name: TEST docker scout cves
run: ./docker-scout cves docker/scout-demo-service:main
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v5
with:
context: https://github.com/docker/scout-demo-service.git#fix-all-cves
push: false
load: true
tags: docker/scout-demo-service:fix
- name: TEST docker scout compare
run: ./docker-scout compare registry://docker/scout-demo-service:main --to local://docker/scout-demo-service:fix

release:
if: startsWith(github.head_ref, 'release/v')
permissions:
contents: write
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Tag name
uses: mad9000/actions-find-and-replace-string@2
id: tagname
with:
source: ${{ github.head_ref }}
find: 'release/'
replace: ''
- name: Merge and Tag
run: |
git config --unset-all http.https://github.com/.extraheader
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git merge --ff-only origin/${{ github.head_ref }}
git tag ${{ steps.tagname.outputs.value }}
git push https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main --tags
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Release
Expand Down
Loading