-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.72 KB
/
release.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
51
52
53
54
55
56
57
58
59
60
61
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
build:
uses: ./.github/workflows/build.yml
release:
runs-on: S3-deployer
needs: build
permissions:
contents: write
steps:
- name: Set Aikido version
run: |
echo "AIKIDO_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Set env
run: |
echo "AIKIDO_S3=s3://aikido-firewall" >> $GITHUB_ENV
echo "AIKIDO_S3_BUCKET=v${{ env.AIKIDO_VERSION }}/linux_x86_64" >> $GITHUB_ENV
echo "AIKIDO_RPM=aikido-php-firewall-${{ env.AIKIDO_VERSION }}-1.x86_64.rpm" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: |
aikido-php-firewall-${{ env.AIKIDO_VERSION }}*
- name: List Artifacts
run: |
ls -l
pwd
- name: Setup AWS CLI Production
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.S3_AWS_ACCESS_KEY_ID_PROD }}
aws-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY_PROD }}
aws-region: eu-west-1
- name: Sync packages to S3 bucket
run: |
ls -l
aws s3 cp ${{ env.AIKIDO_RPM }}/${{ env.AIKIDO_RPM }} ${{ env.AIKIDO_S3 }}/${{ env.AIKIDO_S3_BUCKET }}/${{ env.AIKIDO_RPM }}
- name: Make S3 bucket publicly readable
run: |
aws s3api put-object-acl --acl public-read --bucket aikido-firewall --key ${{ env.AIKIDO_S3_BUCKET }}/${{ env.AIKIDO_RPM }}
- name: Deploy to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
./**/aikido-php-firewall-${{ env.AIKIDO_VERSION }}*