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

build: 🛠 Add artifact publishing to releases #22

Merged
merged 1 commit into from
Nov 13, 2024
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
48 changes: 20 additions & 28 deletions .github/workflows/outputs.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
name: generate outputs
name: Generate Outputs for Review

permissions:
contents: read

on:
merge_group:
pull_request:
push:
branches:
- master
# on:
# push:
# paths:
# - '**.kicad_sch'
# - '**.kicad_pcb'
# pull_request:
# paths:
# - '**.kicad_sch'
# - '**.kicad_pcb'

jobs:
generate_outputs:
build:
name: Generate Outputs for Review
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: gitmarker
run: "for i in *.kicad_pcb; do git rev-parse --short HEAD | xargs -I % sed -i 's/{GITHASH}/%/g' $i; done" # add git marker
- uses: INTI-CMNB/KiBot@v2_k7
with:
# Required - kibot config file
config: config.kibot.yaml
# optional - prefix to output defined in config
dir: output
- name: upload results
uses: actions/upload-artifact@v3
with:
name: output
path: output
- uses: actions/checkout@v4
- name: gitmarker
run: "for i in *.kicad_pcb; do git rev-parse --short HEAD | xargs -I % sed -i 's/{GITHASH}/%/g' $i; done" # add git marker
- uses: INTI-CMNB/KiBot@v2_k7
with:
# Required - kibot config file
config: config.kibot.yaml
# optional - prefix to output defined in config
dir: output
- name: Upload temporary artifacts for review
uses: actions/upload-artifact@v4
with:
name: output
path: output
39 changes: 39 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Upload Pre-Release Asset

permissions:
contents: write

on:
push:
branches:
- master

jobs:
build:
name: Upload Pre-Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set tag hash
id: tag
run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: gitmarker
run: "for i in *.kicad_pcb; do sed -i 's/{GITHASH}/${{ steps.tag.outputs.hash }}/g' $i; done" # add git marker
- uses: INTI-CMNB/KiBot@v2_k7
with:
# Required - kibot config file
config: config.kibot.yaml
# optional - prefix to output defined in config
dir: output
- name: Release with Notes
uses: softprops/action-gh-release@v2
with:
body: Publish new snapshot of PCB @ ${{ github.sha }}
tag_name: preview-${{ steps.tag.outputs.hash }}
prerelease: true
fail_on_unmatched_files: true
files: |
output/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Upload Release Asset

permissions:
contents: write

on:
push:
tags:
- "v*"

jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set tag hash
id: tag
run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: gitmarker
run: "for i in *.kicad_pcb; do sed -i 's/{GITHASH}/${{ steps.tag.outputs.hash }}/g' $i; done" # add git marker
- uses: INTI-CMNB/KiBot@v2_k7
with:
# Required - kibot config file
config: config.kibot.yaml
# optional - prefix to output defined in config
dir: output
- name: Release with Notes
uses: softprops/action-gh-release@v2
with:
body: Publish new version of PCB
tag_name: ${{ github.ref_name }}
prerelease: false
make_latest: true
fail_on_unmatched_files: true
files: |
output/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}