kopia lustrzana https://github.com/gaul/s3proxy
Cleanup the build workflow
rodzic
99c1486fd3
commit
e7dc97a1af
|
@ -3,7 +3,6 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "master"
|
- "master"
|
||||||
- "develop"
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "*"
|
- "*"
|
||||||
|
@ -19,7 +18,6 @@ jobs:
|
||||||
container_version: ${{ fromJSON(steps.docker_action_meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
container_version: ${{ fromJSON(steps.docker_action_meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
||||||
container_revision: ${{ fromJSON(steps.docker_action_meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
container_revision: ${{ fromJSON(steps.docker_action_meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
||||||
container_base: ${{ fromJSON(steps.docker_action_meta.outputs.json).tags[0] }}
|
container_base: ${{ fromJSON(steps.docker_action_meta.outputs.json).tags[0] }}
|
||||||
new_release_version: ${{ steps.version.outputs.new_release_version }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -31,9 +29,6 @@ jobs:
|
||||||
run: echo "::set-output name=defined::true"
|
run: echo "::set-output name=defined::true"
|
||||||
env:
|
env:
|
||||||
MY_KEY: ${{ secrets.DOCKER_PASS }}
|
MY_KEY: ${{ secrets.DOCKER_PASS }}
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: "14"
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: docker_action_meta
|
id: docker_action_meta
|
||||||
uses: docker/metadata-action@v4.0.1
|
uses: docker/metadata-action@v4.0.1
|
||||||
|
@ -44,9 +39,7 @@ jobs:
|
||||||
tags: |
|
tags: |
|
||||||
type=sha,format=long
|
type=sha,format=long
|
||||||
type=sha
|
type=sha
|
||||||
type=semver,pattern={{version}},value=${{ steps.version.outputs.new_release_version }}
|
type=match,pattern=s3proxy-(.*),group=1
|
||||||
type=semver,pattern={{major}},value=${{ steps.version.outputs.new_release_version }}
|
|
||||||
type=semver,pattern={{major}}.{{minor}},value=${{ steps.version.outputs.new_release_version }}
|
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
|
@ -60,7 +53,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
|
|
||||||
# These steps are quick and will work or if fail only because of external issues
|
|
||||||
- uses: actions/setup-java@v2
|
- uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: "temurin"
|
distribution: "temurin"
|
||||||
|
@ -74,7 +66,7 @@ jobs:
|
||||||
#Run tests
|
#Run tests
|
||||||
- name: Maven Set version
|
- name: Maven Set version
|
||||||
run: |
|
run: |
|
||||||
mvn versions:set -DnewVersion=${{ needs.meta.outputs.new_release_version }}
|
mvn versions:set -DnewVersion=${{ needs.meta.outputs.version }}
|
||||||
- name: Maven Package
|
- name: Maven Package
|
||||||
run: |
|
run: |
|
||||||
mvn package -DskipTests
|
mvn package -DskipTests
|
||||||
|
@ -99,7 +91,6 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [runTests, meta]
|
needs: [runTests, meta]
|
||||||
steps:
|
steps:
|
||||||
#Yes we need code
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
@ -109,7 +100,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: pom
|
name: pom
|
||||||
path: .
|
path: .
|
||||||
# These steps are quick and will work or if fail only because of external issues
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
|
@ -122,7 +112,7 @@ jobs:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to GHCR
|
||||||
uses: docker/login-action@v2.0.0
|
uses: docker/login-action@v2.0.0
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
with:
|
with:
|
||||||
|
@ -130,7 +120,6 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
#Generate Meta
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
|
@ -145,37 +134,13 @@ jobs:
|
||||||
REVISION=${{ needs.meta.outputs.container_revision }}
|
REVISION=${{ needs.meta.outputs.container_revision }}
|
||||||
cache-from: type=registry,ref=${{ needs.meta.outputs.container_base }}
|
cache-from: type=registry,ref=${{ needs.meta.outputs.container_base }}
|
||||||
cache-to: type=inline
|
cache-to: type=inline
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
- name: Publish to Docker
|
||||||
node-version: "14"
|
|
||||||
- name: Setup regctl
|
|
||||||
if: github.event_name != 'pull_request' && needs.meta.outputs.dockerhub-publish == 'true'
|
if: github.event_name != 'pull_request' && needs.meta.outputs.dockerhub-publish == 'true'
|
||||||
run: |
|
run: |
|
||||||
curl -L https://github.com/regclient/regclient/releases/download/v0.3.5/regctl-linux-amd64 >/tmp/regctl
|
curl -L https://github.com/regclient/regclient/releases/download/v0.3.5/regctl-linux-amd64 >/tmp/regctl
|
||||||
chmod 755 /tmp/regctl
|
chmod 755 /tmp/regctl
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
if: github.event_name != 'pull_request' && needs.meta.outputs.dockerhub-publish == 'true'
|
|
||||||
id: docker_action_meta
|
|
||||||
uses: docker/metadata-action@v4.0.1
|
|
||||||
with:
|
|
||||||
images: andrewgaul/s3proxy
|
|
||||||
flavor: |
|
|
||||||
latest=false
|
|
||||||
tags: |
|
|
||||||
type=sha
|
|
||||||
type=semver,pattern={{version}},value=${{ needs.meta.outputs.new_release_version }}
|
|
||||||
type=semver,pattern={{major}},value=${{ needs.meta.outputs.new_release_version }}
|
|
||||||
type=semver,pattern={{major}}.{{minor}},value=${{ needs.meta.outputs.new_release_version }}
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=pr
|
|
||||||
type=ref,event=tag
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.licenses=Apache-2.0
|
|
||||||
- name: Publish to Docker
|
|
||||||
if: github.event_name != 'pull_request' && needs.meta.outputs.dockerhub-publish == 'true'
|
|
||||||
run: |
|
|
||||||
for line in $CONTAINER_DEST_TAGS; do echo working on "$line"; /tmp/regctl image copy $SOURCE_CONTAINER $line; done
|
for line in $CONTAINER_DEST_TAGS; do echo working on "$line"; /tmp/regctl image copy $SOURCE_CONTAINER $line; done
|
||||||
env:
|
env:
|
||||||
SOURCE_CONTAINER: ${{ needs.meta.outputs.new_release_version }}
|
SOURCE_CONTAINER: ${{ needs.meta.outputs.container_version }}
|
||||||
CONTAINER_DEST_TAGS: ${{ steps.docker_action_meta.outputs.tags }}
|
CONTAINER_DEST_TAGS: ${{ needs.meta.outputs.container_tags }}
|
||||||
|
|
Ładowanie…
Reference in New Issue