Skip to content

Commit

Permalink
trivial: Add a workflow for automatically releasing a binary on tag e…
Browse files Browse the repository at this point in the history
…vent
  • Loading branch information
superm1 committed Jan 22, 2024
1 parent 1eb8bab commit f5932f9
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: build

name: Build Workflow
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
outputs:
deb: ${{ steps.package.outputs.deb }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: deps
run: |
sudo apt update
sudo apt install debhelper dpkg-dev -y
- name: package
id: package
run: |
mkdir -p tmp
cd tmp && \
ln -s ../fwupd-wrapper ../debian . && \
dpkg-buildpackage -us -uc
echo "deb=$(ls *.deb)" >> $GITHUB_OUTPUT
- name: Capture artifacts
uses: actions/upload-artifact@v3
with:
name: debian package
name: debian
path: |
*.deb
12 changes: 12 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
ci:
uses: ./.github/workflows/build.yaml
secrets: inherit
26 changes: 26 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tag

on:
push:
tags:
- '*'

jobs:
build:
uses: ./.github/workflows/build.yml
secrets: inherit

tag:
name: Tag Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
id: download
with:
name: debian

- name: Release the Package
uses: softprops/action-gh-release@v1
with:
files: ${{ needs.build.outputs.deb }}

0 comments on commit f5932f9

Please sign in to comment.