VERSION: 0.25.5 #766
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: A workflow for building Nerves system | |
on: push | |
jobs: | |
build: | |
name: Build Nerves system | |
runs-on: ubuntu-150GB | |
container: ghcr.io/nerves-project/nerves_system_br:1.24.1 | |
env: | |
ELIXIR_VERSION: 1.15.6-otp-26 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Restore buildroot downloads | |
uses: actions/cache/restore@v3 | |
id: cache | |
with: | |
path: ~/.nerves/dl | |
key: buildroot-cache-${{ hashFiles('VERSION', 'mix.lock') }} | |
restore-keys: | | |
buildroot-cache | |
- name: Setup elixir | |
run: | | |
wget https://repo.hex.pm/builds/elixir/v$ELIXIR_VERSION.zip | |
unzip -d /usr/local/elixir v$ELIXIR_VERSION.zip | |
echo "/usr/local/elixir/bin" >> $GITHUB_PATH | |
- name: Clear Existing Artifacts | |
run: | | |
rm -rf $HOME/.nerves/dl/ly11_system_rpi4-portable* | |
- name: Configure Git Options | |
run: | | |
git config --global url."https://github.com/".insteadOf git://github.com/ | |
- name: Download buildroot sources | |
timeout-minutes: 60 | |
run: | | |
apt-get update | |
apt-get install -y mercurial u-boot-tools autoconf-archive gettext | |
make download-sources | |
- name: Cache buildroot downloads | |
uses: actions/cache/save@v3 | |
with: | |
path: ~/.nerves/dl | |
key: buildroot-cache-${{ hashFiles('VERSION', 'mix.lock') }} | |
- name: build | |
run: | | |
mkdir -p /root/local | |
mkdir -p /root/empty | |
make dist | |
- name: Upload S3 Artifacts | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --follow-symlinks --exclude '**/git/*' | |
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-1' | |
SOURCE_DIR: dist | |
- name: Upload S3 Cache | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --follow-symlinks --exclude '**/git/*' | |
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-1' | |
SOURCE_DIR: $HOME/.nerves/dl | |
- name: List Artifacts | |
if: contains(github.ref, 'tags') | |
run: | | |
ls $HOME/.nerves/dl/ly11_system_rpi4-portable* | |
- name: Upload Artifacts | |
if: contains(github.ref, 'tags') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: /github/home/.nerves/dl/ly11_system_rpi4-portable* | |
file_glob: true | |
tag: ${{ github.ref }} | |
- name: Upload Buildroot cache | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --follow-symlinks | |
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-1' | |
SOURCE_DIR: $HOME/.nerves/dl | |
continue-on-error: true | |
- name: Report Status | |
if: always() | |
uses: ravsamhq/notify-slack-action@v2 | |
with: | |
status: ${{ job.status }} | |
notify_when: 'failure' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK }} |