-
Notifications
You must be signed in to change notification settings - Fork 8
78 lines (77 loc) · 2.82 KB
/
ci.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
name: ci
on:
- push
jobs:
build:
name: Build test ROMs
runs-on: ubuntu-latest
env:
WLA_DX_REPO: vhelin/wla-dx
WLA_DX_COMMIT: 89a90a56be5c2b8cf19a9afa3e1b32384ddb1a97
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Ubuntu package lists
run: sudo apt update
- name: Install Ubuntu packages
run: sudo apt install cmake
- name: Cache wla-dx
id: cache
uses: actions/cache@v3
with:
path: ~/wla-dx
key: wla-dx-${{ env.WLA_DX_COMMIT }}
- name: Build wla-dx
if: steps.cache.outputs.cache-hit != 'true'
run: .github/scripts/install_wla-dx.sh
- name: Build test ROMs
run: make clean all
env:
WLA: ~/wla-dx/binaries/wla-gb
WLALINK: ~/wla-dx/binaries/wlalink
- name: Persist built test ROMs
uses: actions/upload-artifact@v4
with:
name: tests
path: build
deploy:
name: Deploy release ZIP
needs: [build]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Ubuntu package lists
run: sudo apt update
- name: Install Ubuntu packages
run: sudo apt install awscli
- name: Install s3-indexer
run: |
mkdir -p "$HOME/bin"
curl -sSL https://gekkio.fi/files/s3-indexer/s3-indexer -o "$HOME/bin/s3-indexer"
chmod +x "$HOME/bin/s3-indexer"
echo "$HOME/bin" >> $GITHUB_PATH
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Download built test ROMs
uses: actions/download-artifact@v4
with:
name: tests
path: build
- name: Generate version identifier
run: |
echo MTS_VERSION="$(date +%Y%m%d-%H%M)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Prepare release
run: .github/scripts/prepare_release.sh mts-"${MTS_VERSION}"
- name: Upload to S3
run: |
aws s3 cp mts-"${MTS_VERSION}".zip s3://mooneye.gekkio.fi/releases/mts/mts-"${MTS_VERSION}"/
aws s3 cp mts-"${MTS_VERSION}".tar.gz s3://mooneye.gekkio.fi/releases/mts/mts-"${MTS_VERSION}"/
aws s3 cp mts-"${MTS_VERSION}".tar.xz s3://mooneye.gekkio.fi/releases/mts/mts-"${MTS_VERSION}"/
s3-indexer --bucket mooneye.gekkio.fi --prefix "releases/mts/mts-${MTS_VERSION}" --title "Index of mts-${MTS_VERSION}" --region eu-west-1 --upload
s3-indexer --bucket mooneye.gekkio.fi --prefix "releases/mts" --title "Mooneye Test Suite" --region eu-west-1 --upload