CI: avoid redudant build when making new release

Signed-off-by: Tianling Shen <i@cnsztl.eu.org>
This commit is contained in:
Tianling Shen 2023-05-09 20:36:47 +08:00 committed by Zxilly
parent 8c44ffa7c4
commit 23e7f2afb7

View File

@ -8,13 +8,10 @@ on:
pull_request:
paths-ignore:
- '**.md'
release:
types:
- published
jobs:
build:
name: Test ${{ matrix.arch }}
name: Build ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
@ -76,14 +73,14 @@ jobs:
- name: Store packages
uses: actions/upload-artifact@v3
if: github.event_name != 'release'
if: "!startsWith(github.ref, 'refs/tags/v')"
with:
name: ${{ matrix.arch}}-${{ github.sha}}-packages
path: "*.ipk"
- name: Upload packages
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release'
if: "startsWith(github.ref, 'refs/tags/v')"
with:
repo_token: ${{ github.token }}
file: "*.ipk"