Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow changes #172

Merged
merged 4 commits into from
Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/ci-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ci-matrix

on:
pull_request:
types: [opened, synchronize]
types: [opened, reopened, synchronize]
branches:
- master

Expand All @@ -13,7 +13,7 @@ jobs:
matrix:
target:
- { name: linux, os: ubuntu-latest }
- { name: macos, os: macOS-latest }
- { name: macos, os: macos-latest }
- { name: windows, os: windows-latest }

name: Build node on ${{ matrix.target.os }}
Expand All @@ -25,8 +25,14 @@ jobs:
env:
cache-name: cache-node-modules
with:
path: ~/.cargo/cache
key: ${{ runner.os }}-0001
path: |
~/.cargo/cache/
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build ${{ matrix.target.os }}
run: |
rustup check
Expand Down
109 changes: 50 additions & 59 deletions .github/workflows/s3-release.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,52 @@
name: s3-release

on:
push:
branches:
- master
- 'releases/**'
tags:
- v*
workflow_run:
workflows: [ci-matrix]
types:
- completed

jobs:
build:
strategy:
fail-fast: false
matrix:
target:
- { name: linux, os: ubuntu-latest }
- { name: macos, os: macOS-latest }
- { name: windows, os: windows-latest }

name: Build node on ${{ matrix.target.os }}
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@v3
- name: Cache sccache results
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.cargo/cache
key: ${{ runner.os }}-0001
- name: Build ${{ matrix.target.os }}
run: |
rustup check
case "$OSTYPE" in
msys)
echo "Windows doesn't like it when rustup updates itself"
rustup update --no-self-update stable
;;
*)
echo "Linux and macOS don't need manual suppression of rustup self update"
rustup update stable
;;
esac
rustup check
rustup component add rustfmt
rustup component add clippy
./ci/all.sh
./ci/multinode_integration_test.sh
./ci/collect_results.sh
shell: bash
- name: Publish ${{ matrix.target.os }}
uses: actions/upload-artifact@v3
with:
name: Node-${{ matrix.target.name }}
path: results/generated/bin
deploy_to_s3:
needs: ["build"]
deploy_to_versioned_s3:
if: startsWith(github.head_ref, 'v*') != true
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
id: download
- 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
- name: 'Echo download path'
run: echo ${{steps.download.outputs.download-path}}
run: ls -R download
- name: 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.head_ref }}'
SOURCE_DIR: download

deploy_to_latest_s3:
if: startsWith(github.head_ref, 'v*') == true
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
- name: S3 Sync
uses: jakejarvis/s3-sync-action@v0.5.1
with:
Expand All @@ -74,4 +57,12 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-2'
DEST_DIR: 'Node/latest'
SOURCE_DIR: ${{ steps.download.outputs.download-path }}
SOURCE_DIR: download
- 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 }}