-
Notifications
You must be signed in to change notification settings - Fork 15
50 lines (42 loc) · 1.5 KB
/
deploy-toolchain-action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Deploy Artifacts
on:
workflow_call:
inputs:
version:
required: false
type: string
description: Version to author
jobs:
upload_artifacts:
name: Deploy Artifacts ${{ matrix.host }}/${{ matrix.target }}
runs-on:
- self-hosted
- linux
- repo-release
environment: release
strategy:
matrix:
host:
- x86_64
- aarch64
target:
- x86_64
- aarch64
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: toolchain-${{ matrix.host }}-${{ matrix.target }}-linux-gnu.tar.xz
path: release-artifacts/
- name: Get Salt Project GitHub Actions Bot Environment
id: spb-environment
run: |
TOKEN=$(curl -sS -f -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 30")
SPB_ENVIRONMENT=$(curl -sS -f -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/tags/instance/spb:environment)
echo "spb-environment=$SPB_ENVIRONMENT" >> "$GITHUB_OUTPUT"
- name: Install `awscli`
run: |
pip3 install awscli
- name: "Deploy Toolchain: ${{ matrix.host }}/${{ matrix.target }}-linux-gnu.tar.xz"
run: |
aws s3 cp release-artifacts/* s3://salt-project-${{ steps.spb-environment.outputs.spb-environment }}-salt-artifacts-release/relenv/${{ inputs.version }}/toolchain/${{ matrix.host }}/${{ matrix.target }}-linux-gnu.tar.xz