Skip to content

Commit

Permalink
Update CI to address depreaction warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ARolek committed Sep 14, 2023
1 parent 3043c97 commit ee0bddc
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/actions/amazon-linux-build-action/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
cd cmd/tegola_lambda

# build the binary
go build \
GOARCH=${GOARCH} go build \
-mod vendor \
-tags lambda.norpc \
-ldflags "-w -X ${BuildPkg}.Version=${VERSION} -X ${BuildPkg}.GitRevision=${GIT_REVISION} -X ${BuildPkg}.GitBranch=${GIT_BRANCH}" \
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/tegola-upload-path/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ runs:
shell: bash

- id: compute-path
run: echo "::set-output name=dir-path::${TEGOLA_PATH}"
run: echo "dir-path=${TEGOLA_PATH}" >> $GITHUB_OUTPUT
shell: bash
34 changes: 19 additions & 15 deletions .github/actions/upload-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ name: upload artifact
description: "upload generated artifacts including release"
inputs:
artifact_name:
description: "name of the artifact"
description: "name of the binary to archive and upload"
default: "tegola"
required: false
upload_postfix:
description: "uploaded name of the artifact"
default: "linux_amd64"
cmd_subdir:
description: "the subdirectory under cmd/ the built artifact resides (tegola or tegola_lambda)"
default: "tegola"
required: false
release_archive_name:
description: "name of the final archive to upload (excluding the .zip extension)"
default: "tegola_linux_amd64"
required: false
github_token:
description: "github token"
Expand All @@ -19,29 +23,29 @@ runs:
- id: zip-path
uses: ./.github/actions/tegola-upload-path
with:
name: ${{ inputs.artifact_name }}
name: ${{ inputs.cmd_subdir }}

# workaround for archives losing permissions
# https://github.com/actions/upload-artifact/issues/38
- name: Zip (not windows)
if: ${{ runner.os != 'Windows' }}
run: |
cd ${{steps.zip-path.outputs.dir-path}}
zip -9 -D tegola.zip ${{inputs.artifact_name}}
cd ${{ steps.zip-path.outputs.dir-path }}
zip -9 -D tegola.zip ${{ inputs.artifact_name }}
shell: bash
if: ${{ runner.os != 'Windows' }}

- name: Zip (windows)
if: ${{ runner.os == 'Windows' }}
run: |
cd ${{steps.zip-path.outputs.dir-path}}
7z a tegola.zip ${{inputs.artifact_name}}.exe
cd ${{ steps.zip-path.outputs.dir-path }}
7z a tegola.zip ${{ inputs.artifact_name }}.exe
shell: pwsh
if: ${{ runner.os == 'Windows' }}

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{inputs.artifact_name}}${{inputs.upload_postfix}}
path: ${{steps.zip-path.outputs.dir-path}}tegola.zip
name: ${{ inputs.release_archive_name }}
path: ${{ steps.zip-path.outputs.dir-path }}tegola.zip

- name: Upload release asset
if: github.event_name == 'release'
Expand All @@ -50,6 +54,6 @@ runs:
GITHUB_TOKEN: ${{ inputs.github_token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{steps.zip-path.outputs.dir-path}}tegola.zip
asset_name: ${{inputs.artifact_name}}${{inputs.upload_postfix}}.zip
asset_path: ${{ steps.zip-path.outputs.dir-path }}tegola.zip
asset_name: ${{ inputs.release_archive_name }}.zip
asset_content_type: application/zip
22 changes: 12 additions & 10 deletions .github/workflows/on_release_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
artifact_name: "tegola"
upload_postfix: "_linux_amd64"
release_archive_name: "tegola_linux_amd64"

build_linux_arm:
name: Build for Linux (arm64)
Expand Down Expand Up @@ -127,11 +127,11 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
artifact_name: "tegola"
upload_postfix: "_linux_arm64"
release_archive_name: "tegola_linux_arm64"

build_tegola_lambda_amd64:
name: Build tegola_lambda on Amazon Linux
needs: [gen_version]
name: Build tegola_lambda on Amazon Linux (amd64)
needs: [gen_version,build_ui]
runs-on: ubuntu-22.04

steps:
Expand All @@ -156,11 +156,12 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
artifact_name: "bootstrap"
upload_postfix: "_amd64"
cmd_subdir: "tegola_lambda"
release_archive_name: "tegola_lambda_amd64"

build_tegola_lambda_arm64:
name: Build tegola_lambda on Amazon Linux
needs: [gen_version]
name: Build tegola_lambda on Amazon Linux (arm64)
needs: [gen_version,build_ui]
runs-on: ubuntu-22.04

steps:
Expand All @@ -185,7 +186,8 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
artifact_name: "bootstrap"
upload_postfix: "_arm64"
cmd_subdir: "tegola_lambda"
release_archive_name: "tegola_lambda_arm64"

build_macos:
name: Build for MacOS
Expand Down Expand Up @@ -213,7 +215,7 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
artifact_name: "tegola"
upload_postfix: "_darwin_amd64"
release_archive_name: "tegola_darwin_amd64"

build_docker:
name: Build Docker image and publish to Docker Hub
Expand Down Expand Up @@ -311,4 +313,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
artifact_name: "tegola"
upload_postfix: "_windows_amd64"
release_archive_name: "tegola_windows_amd64"

0 comments on commit ee0bddc

Please sign in to comment.