|
1 | 1 | name: s3-release |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - master |
7 | | - - 'releases/**' |
8 | | - tags: |
9 | | - - v* |
| 4 | + workflow_run: |
| 5 | + workflows: [ci-matrix] |
| 6 | + types: |
| 7 | + - completed |
10 | 8 |
|
11 | 9 | jobs: |
12 | | - build: |
13 | | - strategy: |
14 | | - fail-fast: false |
15 | | - matrix: |
16 | | - target: |
17 | | - - { name: linux, os: ubuntu-latest } |
18 | | - - { name: macos, os: macOS-latest } |
19 | | - - { name: windows, os: windows-latest } |
20 | | - |
21 | | - name: Build node on ${{ matrix.target.os }} |
22 | | - runs-on: ${{ matrix.target.os }} |
23 | | - steps: |
24 | | - - uses: actions/checkout@v3 |
25 | | - - name: Cache sccache results |
26 | | - uses: actions/cache@v3 |
27 | | - env: |
28 | | - cache-name: cache-node-modules |
29 | | - with: |
30 | | - path: ~/.cargo/cache |
31 | | - key: ${{ runner.os }}-0001 |
32 | | - - name: Build ${{ matrix.target.os }} |
33 | | - run: | |
34 | | - rustup check |
35 | | - case "$OSTYPE" in |
36 | | - msys) |
37 | | - echo "Windows doesn't like it when rustup updates itself" |
38 | | - rustup update --no-self-update stable |
39 | | - ;; |
40 | | - *) |
41 | | - echo "Linux and macOS don't need manual suppression of rustup self update" |
42 | | - rustup update stable |
43 | | - ;; |
44 | | - esac |
45 | | - rustup check |
46 | | - rustup component add rustfmt |
47 | | - rustup component add clippy |
48 | | - ./ci/all.sh |
49 | | - ./ci/multinode_integration_test.sh |
50 | | - ./ci/collect_results.sh |
51 | | - shell: bash |
52 | | - - name: Publish ${{ matrix.target.os }} |
53 | | - uses: actions/upload-artifact@v3 |
54 | | - with: |
55 | | - name: Node-${{ matrix.target.name }} |
56 | | - path: results/generated/bin |
57 | | - deploy_to_s3: |
58 | | - needs: ["build"] |
| 10 | + deploy_to_versioned_s3: |
| 11 | + if: startsWith(github.head_ref, 'v*') != true |
59 | 12 | runs-on: ubuntu-latest |
60 | 13 | steps: |
61 | | - - uses: actions/download-artifact@v3 |
62 | | - id: download |
| 14 | + - uses: actions/checkout@v3 |
| 15 | + - name: Download artifacts from PR |
| 16 | + run: | |
| 17 | + mkdir download |
| 18 | + cd download |
| 19 | + gh run download ${{ github.event.workflow_run.id }} |
| 20 | + env: |
| 21 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
63 | 22 | - name: Display structure of downloaded files |
64 | | - run: ls -R |
65 | | - - name: 'Echo download path' |
66 | | - run: echo ${{steps.download.outputs.download-path}} |
| 23 | + run: ls -R download |
| 24 | + - name: S3 Sync |
| 25 | + uses: jakejarvis/[email protected] |
| 26 | + with: |
| 27 | + args: --acl private --follow-symlinks --delete |
| 28 | + env: |
| 29 | + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} |
| 30 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 31 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 32 | + AWS_REGION: 'us-west-2' |
| 33 | + DEST_DIR: 'Node/${{ github.head_ref }}' |
| 34 | + SOURCE_DIR: download |
| 35 | + |
| 36 | + deploy_to_latest_s3: |
| 37 | + if: startsWith(github.head_ref, 'v*') == true |
| 38 | + runs-on: ubuntu-latest |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v3 |
| 41 | + - name: Download artifacts from PR |
| 42 | + run: | |
| 43 | + mkdir download |
| 44 | + cd download |
| 45 | + gh run download ${{ github.event.workflow_run.id }} |
| 46 | + env: |
| 47 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + - name: Display structure of downloaded files |
| 49 | + run: ls -R download |
67 | 50 | - name: S3 Sync |
68 | 51 | uses: jakejarvis/[email protected] |
69 | 52 | with: |
|
74 | 57 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
75 | 58 | AWS_REGION: 'us-west-2' |
76 | 59 | DEST_DIR: 'Node/latest' |
77 | | - SOURCE_DIR: ${{ steps.download.outputs.download-path }} |
| 60 | + SOURCE_DIR: download |
| 61 | + - name: Invalidate Binaries CloudFront |
| 62 | + |
| 63 | + env: |
| 64 | + DISTRIBUTION: ${{ secrets.DISTRIBUTION }} |
| 65 | + PATHS: "/Node*" |
| 66 | + AWS_REGION: "us-west-2" |
| 67 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 68 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
0 commit comments