Skip to content

Commit

Permalink
ci: automatic release action
Browse files Browse the repository at this point in the history
configure the Github Action to automatically create a release of the chip when pushing a tag
  • Loading branch information
urish committed Dec 13, 2022
1 parent 62451bc commit fadf9f6
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 26 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build Chip

on:
push:
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Build chip
uses: wokwi/wokwi-chip-clang-action@main
with:
sources: "src/main.c"
- name: Copy chip.json
run: sudo cp chip.json dist
- name: 'Upload Artifacts'
uses: actions/upload-artifact@v3
with:
name: chip
path: |
dist/chip.json
dist/chip.wasm
# The release job only runs when you push a tag starting with "v", e.g. v1.0.0
release:
name: Release
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Download compiled chip
uses: actions/download-artifact@v3
with:
name: chip
path: chip
- name: Create a zip archive
run: cd chip && zip -9 ../chip.zip chip.*
env:
ZIP_VERSION: ${{ github.ref_name }}
- name: Upload release
uses: ncipollo/release-action@v1
with:
artifacts: chip.zip
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
26 changes: 0 additions & 26 deletions .github/workflows/chip.yaml

This file was deleted.

0 comments on commit fadf9f6

Please sign in to comment.