Skip to content

Update upload-artifact CI #58

Update upload-artifact CI

Update upload-artifact CI #58

Workflow file for this run

name: Code CI
on:
push:
pull_request:
jobs:
make_zpkg:
runs-on: ubuntu-latest
steps:
# Git repositories
- name: Checkout Source
uses: actions/checkout@v2
with:
path: PandABlocks-webcontrol
# Require history to get back to last tag for version number of branches
fetch-depth: 0
- name: Checkout PandABlocks-rootfs
uses: actions/checkout@v2
with:
repository: PandABlocks/PandABlocks-rootfs
path: PandABlocks-rootfs
# Login into ghcr
- name: login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build
- name: Make
run: |
docker pull ghcr.io/pandablocks/pandablocks-dev-container:latest
docker run \
-v "${{ github.workspace }}:/repos" \
-v "${{ github.workspace }}/build:/build" \
ghcr.io/pandablocks/pandablocks-dev-container:latest\
/bin/bash -c \
"cd PandABlocks-webcontrol && ln -s CONFIG.example CONFIG && make zpkg"
# Artifact
- name: Upload zpkg
uses: actions/upload-artifact@v4
with:
name: zpkg
path: ./PandABlocks-webcontrol/build/panda-webcontrol@*.zpg
release:
needs: [make_zpkg]
runs-on: ubuntu-latest
# Make a release on every tag
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
name: zpkg
path: zpkg
- name: Github Release
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: softprops/action-gh-release@2d72d869af3bf23602f9593a1e3fd739b80ac1eb # v0.1.12
with:
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
files: zpkg/*
body: See [Changelog](CHANGELOG.rst) for more details
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}