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

Replace mktemp with GitHub built-in runner.temp context variable. #949

Merged
merged 1 commit into from
Jul 19, 2024
Merged
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
22 changes: 10 additions & 12 deletions .github/workflows/container-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
with:
tool-cache: false
docker-images: false
- name: Create temporary directories
run: |
mkdir ${{ runner.temp }}/bin
mkdir ${{ runner.temp}}/artifacts
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand Down Expand Up @@ -78,11 +82,6 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
push: true
- name: Create image export directory
id: export-dir
run: |
tmpdir=$(mktemp -d)
echo path=${tmpdir} >> $GITHUB_OUTPUT
- name: Export plain binaries from built images
uses: docker/build-push-action@v6
with:
Expand All @@ -94,28 +93,27 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
outputs: |
type=local,dest=${{ steps.export-dir.outputs.path }}
type=local,dest=${{ runner.temp }}/bin
- name: Disambiguate binaries by platform
id: artifacts
run: |
dirname=${{ steps.export-dir.outputs.path }}
dirname=${{ runner.temp }}/bin
refname=${{ inputs.git_ref_basename }}
package=${{ inputs.docker_build_arg_package }}
artifact_dir=$(mktemp -d)
artifact_dir=${{ runner.temp }}/artifacts
for platform in linux_amd64 linux_arm64; do
cp ${dirname}/${platform}/usr/local/bin/${package} ${artifact_dir}/${package}_${refname}_${platform}
done
echo dir="${artifact_dir}" >> $GITHUB_OUTPUT
- name: Create genesis runtime bytecode artifact
if: inputs.docker_build_arg_package == 'entropy'
run: |
${{ steps.artifacts.outputs.dir }}/${{ inputs.docker_build_arg_package }}_${{ inputs.git_ref_basename }}_linux_amd64 \
${{ runner.temp }}/artifacts/${{ inputs.docker_build_arg_package }}_${{ inputs.git_ref_basename }}_linux_amd64 \
build-spec --chain testnet \
> ${{ steps.artifacts.outputs.dir }}/${{ inputs.docker_build_arg_package }}-chain-spec-${{ inputs.git_ref_basename }}-${{ github.sha }}.json
> ${{ runner.temp }}/artifacts/${{ inputs.docker_build_arg_package }}-chain-spec-${{ inputs.git_ref_basename }}-${{ github.sha }}.json
- name: Upload ${{ inputs.docker_build_arg_package }} binary artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.docker_build_arg_package}}_${{ inputs.git_ref_basename }}
path: ${{ steps.artifacts.outputs.dir }}/${{ inputs.docker_build_arg_package }}*
path: ${{ runner.temp }}/artifacts/${{ inputs.docker_build_arg_package }}*
if-no-files-found: error
retention-days: 5
Loading