mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
Update actions to keep permissions (#11289)
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu> Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
This commit is contained in:
parent
6bfb1a2ce2
commit
4d13976e47
2
.github/actions/build/action.yml
vendored
2
.github/actions/build/action.yml
vendored
|
@ -18,6 +18,6 @@ runs:
|
||||||
- uses: ./.github/actions/setup_environment
|
- uses: ./.github/actions/setup_environment
|
||||||
- run: ~/go/bin/promu crossbuild -v --parallelism ${{ inputs.parallelism }} --parallelism-thread ${{ inputs.thread }} ${{ inputs.promu_opts }}
|
- run: ~/go/bin/promu crossbuild -v --parallelism ${{ inputs.parallelism }} --parallelism-thread ${{ inputs.thread }} ${{ inputs.promu_opts }}
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: ./.github/actions/save_artefacts
|
- uses: ./.github/actions/save_artifacts
|
||||||
with:
|
with:
|
||||||
directory: .build
|
directory: .build
|
||||||
|
|
5
.github/actions/publish_main/action.yml
vendored
5
.github/actions/publish_main/action.yml
vendored
|
@ -26,10 +26,7 @@ runs:
|
||||||
- uses: ./.github/actions/setup_environment
|
- uses: ./.github/actions/setup_environment
|
||||||
with:
|
with:
|
||||||
enable_docker_multibuild: true
|
enable_docker_multibuild: true
|
||||||
- name: Download all workflow run artifacts
|
- uses: ./.github/actions/restore_artifacts
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifact
|
|
||||||
- uses: ./.github/actions/publish_images
|
- uses: ./.github/actions/publish_images
|
||||||
if: inputs.docker_hub_organization != '' && inputs.docker_hub_login != ''
|
if: inputs.docker_hub_organization != '' && inputs.docker_hub_login != ''
|
||||||
with:
|
with:
|
||||||
|
|
5
.github/actions/publish_release/action.yml
vendored
5
.github/actions/publish_release/action.yml
vendored
|
@ -26,10 +26,7 @@ runs:
|
||||||
- uses: ./.github/actions/setup_environment
|
- uses: ./.github/actions/setup_environment
|
||||||
with:
|
with:
|
||||||
enable_docker_multibuild: true
|
enable_docker_multibuild: true
|
||||||
- name: Download all workflow run artifacts
|
- uses: ./.github/actions/restore_artifacts
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifact
|
|
||||||
- run: promu crossbuild tarballs
|
- run: promu crossbuild tarballs
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: promu checksum .tarballs
|
- run: promu checksum .tarballs
|
||||||
|
|
22
.github/actions/restore_artifacts/action.yml
vendored
Normal file
22
.github/actions/restore_artifacts/action.yml
vendored
Normal file
|
@ -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
.github/actions/save_artefacts/action.yml
vendored
18
.github/actions/save_artefacts/action.yml
vendored
|
@ -1,18 +0,0 @@
|
||||||
# To preserve the directory structure, save an additional empty file at
|
|
||||||
# the root of the working directory. GitHub action uses the least common
|
|
||||||
# ancestor of all the search paths as the root directory for artefacts.
|
|
||||||
name: Save artefacts
|
|
||||||
inputs:
|
|
||||||
directory:
|
|
||||||
type: string
|
|
||||||
description: Path of the directory to save
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- run: touch .keep
|
|
||||||
shell: bash
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ inputs.directory }}
|
|
||||||
.keep
|
|
17
.github/actions/save_artifacts/action.yml
vendored
Normal file
17
.github/actions/save_artifacts/action.yml
vendored
Normal file
|
@ -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
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -39,7 +39,7 @@ jobs:
|
||||||
- run: make assets-tarball
|
- run: make assets-tarball
|
||||||
- run: make ui-lint
|
- run: make ui-lint
|
||||||
- run: make ui-test
|
- run: make ui-test
|
||||||
- uses: ./.github/actions/save_artefacts
|
- uses: ./.github/actions/save_artifacts
|
||||||
with:
|
with:
|
||||||
directory: .tarballs
|
directory: .tarballs
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ jobs:
|
||||||
uses: ./.github/workflows/codeql-analysis.yml
|
uses: ./.github/workflows/codeql-analysis.yml
|
||||||
|
|
||||||
publish_main:
|
publish_main:
|
||||||
name: Publish main branch artefacts
|
name: Publish main branch artifacts
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [test_ui, test_go, test_windows, golangci, codeql, build_all]
|
needs: [test_ui, test_go, test_windows, golangci, codeql, build_all]
|
||||||
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
|
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
|
||||||
|
|
Loading…
Reference in a new issue