Skip to content

Update dependencies #180

Update dependencies

Update dependencies #180

Workflow file for this run

name: Build
on:
push:
tags:
- '*.*.*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.20
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
mkdir auth-proxy-tools_{amd64,darwin,power8,arm64,windows}
echo "AMD64 build"
make build_amd64; mv auth-proxy-server auth-token token-manager decode-token auth-proxy-tools_amd64
echo "Darwin build"
make build_darwin; mv auth-proxy-server auth-token token-manager decode-token auth-proxy-tools_darwin
echo "Power8 build"
make build_power8; mv auth-proxy-server auth-token token-manager decode-token auth-proxy-tools_power8
echo "ARM64 build"
make build_arm64; mv auth-proxy-server auth-token token-manager decode-token auth-proxy-tools_arm64
echo "Windows build"
make build_windows; mv auth-proxy-server auth-token token-manager decode-token auth-proxy-tools_windows
echo "gRPC server build"
cd grpc
make build_amd64; mv grpc-proxy-server ../auth-proxy-tools_amd64
make build_darwin; mv grpc-proxy-server ../auth-proxy-tools_darwin
make build_power8; mv grpc-proxy-server ../auth-proxy-tools_power8
make build_arm64; mv grpc-proxy-server ../auth-proxy-tools_arm64
make build_windows; mv grpc-proxy-server ../auth-proxy-tools_windows
cd -
echo "Tar all builds"
tar cfz auth-proxy-tools_amd64.tar.gz auth-proxy-tools_amd64
tar cfz auth-proxy-tools_darwin.tar.gz auth-proxy-tools_darwin
tar cfz auth-proxy-tools_power8.tar.gz auth-proxy-tools_power8
tar cfz auth-proxy-tools_arm64.tar.gz auth-proxy-tools_arm64
tar cfz auth-proxy-tools_windows.tar.gz auth-proxy-tools_windows
echo "Build full set of tools"
make release
echo "Generate CHANGES.md and LAST_CHANGES.md"
make changes
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
bodyFile: "LAST_CHANGES.md"
draft: false
prerelease: false
- name: Upload auth-proxy-tools
id: upload-auth-proxy-tools
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./auth-proxy-tools.tar.gz
asset_name: auth-proxy-tools.tar.gz
asset_content_type: application/octet-stream
- name: Upload amd64 binary
id: upload-auth-proxy-server
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./auth-proxy-tools_amd64.tar.gz
asset_name: auth-proxy-tools_amd64.tar.gz
asset_content_type: application/octet-stream
- name: Upload darwin binary
id: upload-auth-proxy-server-darwin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./auth-proxy-tools_darwin.tar.gz
asset_name: auth-proxy-tools_darwin.tar.gz
asset_content_type: application/octet-stream
- name: Upload power8 binary
id: upload-auth-proxy-server-power8
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./auth-proxy-tools_power8.tar.gz
asset_name: auth-proxy-tools_power8.tar.gz
asset_content_type: application/octet-stream
- name: Upload arm64 binary
id: upload-auth-proxy-server-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./auth-proxy-tools_arm64.tar.gz
asset_name: auth-proxy-tools_arm64.tar.gz
asset_content_type: application/octet-stream
- name: Upload windows binary
id: upload-auth-proxy-server-windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./auth-proxy-tools_windows.tar.gz
asset_name: auth-proxy-tools_windows.tar.gz
asset_content_type: application/octet-stream
- name: Get the Ref
id: get-ref
uses: ankitvgupta/ref-to-tag-action@master
with:
ref: ${{ github.ref }}
head_ref: ${{ github.head_ref }}
- name: Build image
run: |
curl -ksLO https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/docker/auth-proxy-server/Dockerfile
sed -i -e "s,ENV TAG=.*,ENV TAG=${{steps.get-ref.outputs.tag}},g" Dockerfile
docker build . --tag docker.pkg.github.com/dmwm/auth-proxy-server/auth-proxy-server
docker tag docker.pkg.github.com/dmwm/auth-proxy-server/auth-proxy-server registry.cern.ch/cmsweb/auth-proxy-server
- name: Login to registry.cern.ch
uses: docker/[email protected]
with:
registry: registry.cern.ch
username: ${{ secrets.CERN_LOGIN }}
password: ${{ secrets.CERN_TOKEN }}
- name: Publish image to registry.cern.ch
uses: docker/build-push-action@v1
with:
username: ${{ secrets.CERN_LOGIN }}
password: ${{ secrets.CERN_TOKEN }}
registry: registry.cern.ch
repository: cmsweb/auth-proxy-server
tag_with_ref: true
# - name: Login to docker github registry
# uses: docker/[email protected]
# with:
# registry: docker.pkg.github.com
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Publish image
# uses: docker/build-push-action@v1
# with:
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# registry: docker.pkg.github.com
# repository: dmwm/auth-proxy-server/auth-proxy-server
# tag_with_ref: true
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v2
# with:
# context: .
# file: ./Dockerfile
# load: true
# tags: cmssw/auth-proxy-server:${{steps.get-ref.outputs.tag}}
# - run: docker push cmssw/auth-proxy-server:${{steps.get-ref.outputs.tag}}