403b820698
SonarQube Scan / SonarQube Trigger (push) Successful in 3m57s
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | major | `v6` → `v7` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v7.0.0`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v700) [Compare Source](https://github.com/actions/checkout/compare/v7.0.0...v7.0.0) - Block checking out fork PR for pull\_request\_target and workflow\_run by [@​aiqiaoy](https://github.com/aiqiaoy) in [#​2454](https://github.com/actions/checkout/pull/2454) - Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2458](https://github.com/actions/checkout/pull/2458) - Bump flatted from 3.3.1 to 3.4.2 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2460](https://github.com/actions/checkout/pull/2460) - Bump js-yaml from 4.1.0 to 4.2.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2461](https://github.com/actions/checkout/pull/2461) - Bump [@​actions/core](https://github.com/actions/core) and [@​actions/tool-cache](https://github.com/actions/tool-cache) and Remove uuid by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2459](https://github.com/actions/checkout/pull/2459) - upgrade module to esm and update dependencies by [@​aiqiaoy](https://github.com/aiqiaoy) in [#​2463](https://github.com/actions/checkout/pull/2463) - Bump the minor-npm-dependencies group across 1 directory with 3 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2462](https://github.com/actions/checkout/pull/2462) ### [`v7`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v701) [Compare Source](https://github.com/actions/checkout/compare/v6.0.3...v7.0.0) - Bump github/codeql-action from 3 to 4 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2475](https://github.com/actions/checkout/pull/2475) - Bump actions/setup-node from 4 to 6 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2477](https://github.com/actions/checkout/pull/2477) - Bump docker/build-push-action from 6.5.0 to 7.2.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2478](https://github.com/actions/checkout/pull/2478) - Bump docker/login-action from 3.3.0 to 4.2.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2479](https://github.com/actions/checkout/pull/2479) - Bump actions/checkout from 6 to 7 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2488](https://github.com/actions/checkout/pull/2488) - Bump actions/upload-artifact from 4 to 7 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2476](https://github.com/actions/checkout/pull/2476) - eslint 9 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2474](https://github.com/actions/checkout/pull/2474) - Bump the minor-actions-dependencies group with 2 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2499](https://github.com/actions/checkout/pull/2499) - skip running unsafe pr check if input is default by [@​aiqiaoy](https://github.com/aiqiaoy) in [#​2518](https://github.com/actions/checkout/pull/2518) - trim only ascii whitespace for branch by [@​aiqiaoy](https://github.com/aiqiaoy) in [#​2521](https://github.com/actions/checkout/pull/2521) - escape values passed to --unset by [@​aiqiaoy](https://github.com/aiqiaoy) in [#​2530](https://github.com/actions/checkout/pull/2530) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNTcuOSIsInVwZGF0ZWRJblZlciI6IjQzLjI1Ny45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: #159 Co-authored-by: Renovate-Clanker <renovate-bot@fossy.my.id> Co-committed-by: Renovate-Clanker <renovate-bot@fossy.my.id>
112 lines
3.8 KiB
YAML
112 lines
3.8 KiB
YAML
name: Docker Build and Push
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
test:
|
|
name: Run Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 'stable'
|
|
cache: false
|
|
|
|
- name: Install dependencies
|
|
run: go mod download
|
|
|
|
- name: Run go vet
|
|
run: go vet ./...
|
|
|
|
- name: Run tests
|
|
run: go test -v -p 4 ./...
|
|
|
|
|
|
build-and-push:
|
|
name: Build and Push Docker Image
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Log in to Docker Registry
|
|
uses: docker/login-action@v4
|
|
with:
|
|
registry: git.fossy.my.id
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Extract version and determine release type
|
|
id: version
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/v}
|
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
|
echo "COMMIT=${{ github.sha }}" >> $GITHUB_OUTPUT
|
|
|
|
if echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$'; then
|
|
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
|
MINOR=$(echo "$VERSION" | cut -d. -f2)
|
|
PATCH=$(echo "$VERSION" | cut -d. -f3 | cut -d- -f1)
|
|
|
|
echo "MAJOR=$MAJOR" >> $GITHUB_OUTPUT
|
|
echo "MINOR=$MINOR" >> $GITHUB_OUTPUT
|
|
echo "PATCH=$PATCH" >> $GITHUB_OUTPUT
|
|
|
|
if echo "$VERSION" | grep -q '-'; then
|
|
PRERELEASE_TAG=$(echo "$VERSION" | cut -d- -f2 | cut -d. -f1)
|
|
echo "IS_PRERELEASE=true" >> $GITHUB_OUTPUT
|
|
echo "PRERELEASE_TAG=$PRERELEASE_TAG" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "IS_PRERELEASE=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
else
|
|
echo "Invalid version format: $VERSION"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Build and push Docker image (release)
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnel-please:v${{ steps.version.outputs.VERSION }}
|
|
git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnel-please:release
|
|
git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnel-please:v${{ steps.version.outputs.MAJOR }}.${{ steps.version.outputs.MINOR }}
|
|
git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnel-please:v${{ steps.version.outputs.MAJOR }}
|
|
git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnel-please:latest
|
|
platforms: linux/amd64,linux/arm64
|
|
build-args: |
|
|
VERSION=${{ steps.version.outputs.VERSION }}
|
|
BUILD_DATE=${{ steps.version.outputs.BUILD_DATE }}
|
|
COMMIT=${{ steps.version.outputs.COMMIT }}
|
|
if: steps.version.outputs.IS_PRERELEASE == 'false'
|
|
|
|
- name: Build and push Docker image (pre-release)
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnel-please:v${{ steps.version.outputs.VERSION }}
|
|
git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnel-please:staging
|
|
platforms: linux/amd64,linux/arm64
|
|
build-args: |
|
|
VERSION=${{ steps.version.outputs.VERSION }}
|
|
BUILD_DATE=${{ steps.version.outputs.BUILD_DATE }}
|
|
COMMIT=${{ steps.version.outputs.COMMIT }}
|
|
if: steps.version.outputs.IS_PRERELEASE == 'true' |