-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (80 loc) · 2.51 KB
/
build_app_runner.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build App Runner
on:
workflow_dispatch:
release:
types: [published]
pull_request:
branches: [stable]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
check_tag:
name: Check Tag Name
runs-on: ubuntu-latest
outputs:
is_valid_tag: ${{ steps.check.outputs.is_valid }}
steps:
- id: check
run: |
if [[ "${{ github.ref }}" =~ ^refs/tags/app-runner/ ]]; then
echo "is_valid=true" >> "$GITHUB_OUTPUT"
else
echo "is_valid=false" >> "$GITHUB_OUTPUT"
echo "::notice::Invalid tag format. Expected tag to start with 'app-runner/'"
fi
build_app_runner:
name: Build App Runner
needs: check_tag
# Run if:
# - It's a PR to stable branch, or
# - It's a manual trigger, or
# - It's a release with valid tag
if: >
${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && needs.check_release_tag.outputs.is_valid_tag == 'true') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build App Runner
uses: ./.github/actions/build-app-runner
id: build
with:
output-path: build-output
source-path: app_runner
- name: Comment PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ App Runner build completed successfully!'
})
publish_release_artifact:
name: Publish Release Artifact
runs-on: ubuntu-latest
needs: build_app_runner
if: ${{ github.event_name == 'release' }}
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: app_runner_linux_x86_64
path: app_runner_linux_x86_64
- name: Zip for release
run: |
cd app_runner_linux_x86_64
zip -r app_runner_linux_x86_64.zip *
ls -l
- name: Print folder structure
run: |
tree
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
files: |
app_runner_linux_x86_64/app_runner_linux_x86_64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}