Skip to content

Commit

Permalink
Update actions to keep permissions
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Pivotto <[email protected]>
  • Loading branch information
roidelapluie committed Sep 8, 2022
1 parent 6bfb1a2 commit 8a1df68
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ runs:
- uses: ./.github/actions/setup_environment
- run: ~/go/bin/promu crossbuild -v --parallelism ${{ inputs.parallelism }} --parallelism-thread ${{ inputs.thread }} ${{ inputs.promu_opts }}
shell: bash
- uses: ./.github/actions/save_artefacts
- uses: ./.github/actions/save_artifacts
with:
directory: .build
5 changes: 1 addition & 4 deletions .github/actions/publish_main/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ runs:
- uses: ./.github/actions/setup_environment
with:
enable_docker_multibuild: true
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
with:
name: artifact
- uses: ./.github/actions/restore_artifacts
- uses: ./.github/actions/publish_images
if: inputs.docker_hub_organization != '' && inputs.docker_hub_login != ''
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/actions/publish_release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ runs:
- uses: ./.github/actions/setup_environment
with:
enable_docker_multibuild: true
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
with:
name: artifact
- uses: ./.github/actions/restore_artifacts
- run: promu crossbuild tarballs
shell: bash
- run: promu checksum .tarballs
Expand Down
22 changes: 22 additions & 0 deletions .github/actions/restore_artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Restore artifacts created by save_artifacts.
# Tar is used because the default actions do not preserve directory structure
# and file mode.
name: Restore artifacts
runs:
using: composite
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
with:
name: artifact
path: .artifacts
- run: |
for tar in .artifacts/*.tar
do
tar xvf $tar
done
rm -v .artifacts/*.tar
shell: bash
- uses: actions/upload-artifact@v3
with:
path: artifact-*.tar
18 changes: 0 additions & 18 deletions .github/actions/save_artefacts/action.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/actions/save_artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Tar is used because the default actions do not preserve directory structure
# and file mode.
name: Save artifacts
inputs:
directory:
type: string
description: Path of the directory to save
runs:
using: composite
steps:
- run: |
tar cvf artifact.tar ${{ inputs.directory }}
mv artifact.tar artifact-$(sha1sum artifact.tar|awk '{ print $1 }').tar
shell: bash
- uses: actions/upload-artifact@v3
with:
path: artifact-*.tar
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- run: make assets-tarball
- run: make ui-lint
- run: make ui-test
- uses: ./.github/actions/save_artefacts
- uses: ./.github/actions/save_artifacts
with:
directory: .tarballs

Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
uses: ./.github/workflows/codeql-analysis.yml

publish_main:
name: Publish main branch artefacts
name: Publish main branch artifacts
runs-on: ubuntu-latest
needs: [test_ui, test_go, test_windows, golangci, codeql, build_all]
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
Expand Down

0 comments on commit 8a1df68

Please sign in to comment.