Skip to content
Merged
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
28 changes: 25 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: release

on:
push:
# Sequence of patterns matched against refs/tags
branches:
- main
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

Expand All @@ -14,8 +15,27 @@ permissions:
contents: write

jobs:
version:
name: Generate Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate Version
id: version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch
release_branches: main

build:
name: Build
needs: version
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -86,9 +106,9 @@ jobs:

release:
name: Create Release
needs: build
needs: [build, version]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'

steps:
- name: Download all artifacts
Expand All @@ -97,6 +117,8 @@ jobs:
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ needs.version.outputs.version }}
name: Release v${{ needs.version.outputs.version }}
files: |
popcorn-cli-linux.tar.gz/popcorn-cli-linux.tar.gz
popcorn-cli-windows.zip/popcorn-cli-windows.zip
Expand Down
Loading