diff --git a/.github/workflows/ci-matrix.yml b/.github/workflows/ci-matrix.yml index 6128f12e3..1c4739990 100644 --- a/.github/workflows/ci-matrix.yml +++ b/.github/workflows/ci-matrix.yml @@ -9,17 +9,19 @@ on: jobs: build: strategy: - fail-fast: false + fail-fast: true matrix: target: - - { name: linux, os: ubuntu-latest } - - { name: macos, os: macOS-latest } - - { name: windows, os: windows-latest } + - { name: linux, os: ubuntu-22.04 } + - { name: macos, os: macos-12 } + - { name: windows, os: windows-2022 } name: Build node on ${{ matrix.target.os }} runs-on: ${{ matrix.target.os }} steps: - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Stable with rustfmt and clippy uses: actions-rs/toolchain@v1 with: @@ -36,8 +38,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.OS }}-cargo- + key: ${{ runner.os }}-cargo - name: Build ${{ matrix.target.os }} run: | ./ci/all.sh @@ -49,3 +50,53 @@ jobs: with: name: Node-${{ matrix.target.name }} path: results + deploy_to_s3: + needs: build + strategy: + matrix: + os: [linux, macos, windows] + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/download-artifact@v3 + + - name: Display structure of downloaded files + run: ls -R + + - if: startsWith(github.head_ref, 'GH') + name: Versioned S3 Sync + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl private --follow-symlinks --delete + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'us-west-2' + DEST_DIR: 'Node/${{ github.event.workflow_run.head_branch }}/Node-${{ matrix.os }}' + SOURCE_DIR: 'Node-${{ matrix.os }}/generated/bin/' + + - if: startsWith(github.head_ref, 'v') + name: Latest S3 Sync + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl private --follow-symlinks --delete + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'us-west-2' + DEST_DIR: 'Node/latest/Node-${{ matrix.os }}' + SOURCE_DIR: 'Node-${{ matrix.os }}/generated/bin/' + + - name: Invalidate Binaries CloudFront + uses: chetan/invalidate-cloudfront-action@v2.4 + env: + DISTRIBUTION: ${{ secrets.DISTRIBUTION }} + PATHS: "/Node*" + AWS_REGION: "us-west-2" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/s3-release.yml b/.github/workflows/s3-release.yml deleted file mode 100644 index 3019dd7ba..000000000 --- a/.github/workflows/s3-release.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: s3-release - -on: - workflow_run: - workflows: [ci-matrix] - types: - - completed - -jobs: - deploy_to_s3: - strategy: - matrix: - name: [linux, macos, windows] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Download artifacts from PR - run: | - mkdir download - cd download - gh run download ${{ github.event.workflow_run.id }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Display structure of downloaded files - run: ls -R download - - - if: ${{ startsWith(github.head_ref, 'v*') != true && github.event.workflow_run.conclusion == 'success' }} - name: Versioned S3 Sync - uses: jakejarvis/s3-sync-action@v0.5.1 - with: - args: --acl private --follow-symlinks --delete - env: - AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: 'us-west-2' - DEST_DIR: 'Node/${{ github.event.workflow_run.head_branch }}/Node-${{ matrix.name }}' - SOURCE_DIR: 'download/Node-${{ matrix.name }}/generated/bin/' - - - if: ${{ startsWith(github.head_ref, 'v*') == true && github.event.workflow_run.conclusion == 'success' }} - name: Latest S3 Sync - uses: jakejarvis/s3-sync-action@v0.5.1 - with: - args: --acl private --follow-symlinks --delete - env: - AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: 'us-west-2' - DEST_DIR: 'Node/latest/Node-${{ matrix.name }}' - SOURCE_DIR: 'download/Node-${{ matrix.name }}/generated/bin/' - - - name: Invalidate Binaries CloudFront - uses: chetan/invalidate-cloudfront-action@v2.3 - env: - DISTRIBUTION: ${{ secrets.DISTRIBUTION }} - PATHS: "/Node*" - AWS_REGION: "us-west-2" - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}