Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
loathingKernel committed Nov 14, 2024
1 parent 66a1088 commit 0471d14
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 34 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/build-umu-debian-12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]
workflow_call:


jobs:
build:
Expand All @@ -29,19 +29,30 @@ jobs:
run: apt install -y dh-make dpkg-dev

- name: Setup dh_make quilt files
run: LOGNAME=root dh_make --createorig -y -l -p umu-launcher_1.1.4 || true
run: LOGNAME=root dh_make --createorig -y -l -p umu-launcher || true

- name: Install apt build dependencies
run: apt build-dep -y ./

- name: Build
run: dpkg-buildpackage --no-sign

- name: Move DEB files to upload artifact path
run: mkdir -p results && cp -rvf ../*.deb results/
- name: Move and rename DEB files to upload artifact path
run: |
mkdir -p results
mv ../python3-umu-launcher_${{ github.ref_name }}-1_amd64.deb \
results/python3-umu-launcher_${{ github.ref_name }}-1_amd64_debian-12.deb
mv ../umu-launcher_${{ github.ref_name }}-1_all.deb \
results/umu-launcher_${{ github.ref_name }}-1_all_debian-12.deb
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: python3-umu-launcher_${{ github.ref_name }}-1_amd64_debian-12.deb
path: results/python3-umu-launcher_${{ github.ref_name }}-1_amd64_debian-12.deb

- name: Upload artifact
uses: actions/upload-artifact@v4.0.0
uses: actions/upload-artifact@v4
with:
name: Debian-12
path: results/
name: umu-launcher_${{ github.ref_name }}-1_all_debian-12.deb
path: results/umu-launcher_${{ github.ref_name }}-1_all_debian-12.deb
14 changes: 8 additions & 6 deletions .github/workflows/build-umu-fedora-40.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: UMU RPM Build - Fedora/Nobara
name: UMU RPM Build - Fedora/Nobara 40

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]
workflow_call:


jobs:
build:
Expand Down Expand Up @@ -34,9 +34,11 @@ jobs:
mkdir -p ~/rpmbuild/SOURCES
cp -r . ~/rpmbuild/SOURCES/umu-launcher
rpmbuild -ba packaging/rpm/umu-launcher.spec
mv ~/rpmbuild/RPMS/noarch/umu-launcher-${{ github.ref_name }}*.rpm \
~/rpmbuild/RPMS/noarch/umu-launcher-${{ github.ref_name }}.fc40.noarch.rpm
- name: Fedora-40
uses: actions/upload-artifact@v4.0.0
uses: actions/upload-artifact@v4
with:
name: umu-launcher-rpm-40
path: ~/rpmbuild/RPMS/noarch/*.rpm
name: umu-launcher-${{ github.ref_name }}.fc40.noarch.rpm
path: ~/rpmbuild/RPMS/noarch/umu-launcher-${{ github.ref_name }}.fc40.noarch.rpm
14 changes: 8 additions & 6 deletions .github/workflows/build-umu-fedora-41.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: UMU RPM Build - Fedora/Nobara
name: UMU RPM Build - Fedora/Nobara 41

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]
workflow_call:


jobs:
build:
Expand Down Expand Up @@ -34,9 +34,11 @@ jobs:
mkdir -p ~/rpmbuild/SOURCES
cp -r . ~/rpmbuild/SOURCES/umu-launcher
rpmbuild -ba packaging/rpm/umu-launcher.spec
mv ~/rpmbuild/RPMS/noarch/umu-launcher-${{ github.ref_name }}*.rpm \
~/rpmbuild/RPMS/noarch/umu-launcher-${{ github.ref_name }}.fc41.noarch.rpm
- name: Fedora-41
uses: actions/upload-artifact@v4.0.0
uses: actions/upload-artifact@v4
with:
name: umu-launcher-rpm-41
path: ~/rpmbuild/RPMS/noarch/*.rpm
name: umu-launcher-${{ github.ref_name }}.fc41.noarch.rpm
path: ~/rpmbuild/RPMS/noarch/umu-launcher-${{ github.ref_name }}.fc41.noarch.rpm
47 changes: 47 additions & 0 deletions .github/workflows/build-umu-publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: UMU Publish Release

on:
workflow_call:
inputs:
version:
required: true
type: string
file1:
required: true
type: string
name1:
required: true
type: string
name2:
type: string
default: ""
file2:
type: string
default: ""

jobs:
release:
name: Publish
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: ${{ inputs.name1 }}
file: ${{ inputs.file1 }}
- name: ${{ inputs.name2 }}
file: ${{ inputs.file2 }}
steps:
- name: Download ${{ matrix.name }} from artifact
uses: actions/download-artifact@v4
if: ${{ matrix.name != '' }}
with:
name: ${{ matrix.name }}
- name: Upload ${{ matrix.name }} to release
uses: svenstaro/upload-release-action@v2
if: ${{ matrix.name != '' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.file }}
asset_name: ${{ matrix.name }}
tag: ${{ inputs.version }}
overwrite: true
27 changes: 19 additions & 8 deletions .github/workflows/build-umu-ubuntu-noble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]
workflow_call:


jobs:
build:
Expand All @@ -29,19 +29,30 @@ jobs:
run: apt install -y dh-make dpkg-dev

- name: Setup dh_make quilt files
run: LOGNAME=root dh_make --createorig -y -l -p umu-launcher_1.1.4 || true
run: LOGNAME=root dh_make --createorig -y -l -p umu-launcher || true

- name: Install apt build dependencies
run: apt build-dep -y ./

- name: Build
run: dpkg-buildpackage --no-sign

- name: Move DEB files to upload artifact path
run: mkdir -p results && cp -rvf ../*.deb results/
- name: Move and rename DEB files to upload artifact path
run: |
mkdir -p results
mv ../python3-umu-launcher_${{ github.ref_name }}-1_amd64.deb \
results/python3-umu-launcher_${{ github.ref_name }}-1_amd64_ubuntu-noble.deb
mv ../umu-launcher_${{ github.ref_name }}-1_all.deb \
results/umu-launcher_${{ github.ref_name }}-1_all_ubuntu-noble.deb
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: python3-umu-launcher_${{ github.ref_name }}-1_amd64_ubuntu-noble.deb
path: results/python3-umu-launcher_${{ github.ref_name }}-1_amd64_ubuntu-noble.deb

- name: Upload artifact
uses: actions/upload-artifact@v4.0.0
uses: actions/upload-artifact@v4
with:
name: Ubuntu-24
path: results/
name: umu-launcher_${{ github.ref_name }}-1_all_ubuntu-noble.deb
path: results/umu-launcher_${{ github.ref_name }}-1_all_ubuntu-noble.deb
12 changes: 6 additions & 6 deletions .github/workflows/build-umu-zipapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]
workflow_call:


jobs:
build:
Expand Down Expand Up @@ -37,10 +37,10 @@ jobs:
- name: Create symlink for launchers
# To preserve file mode bits and link file, use a tar archive.
# See https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss
run: cd results && ln -s umu-run umu_run.py && tar cvf Zipapp.tar umu-run umu_run.py
run: cd results && ln -s umu-run umu_run.py && tar cvf umu-launcher-${{ github.ref_name }}-zipapp.tar.gz umu-run umu_run.py

- name: Upload artifact
uses: actions/upload-artifact@v4.0.0
uses: actions/upload-artifact@v4
with:
name: Zipapp
path: results/Zipapp.tar
name: umu-launcher-${{ github.ref_name }}-zipapp.tar.gz
path: results/umu-launcher-${{ github.ref_name }}-zipapp.tar.gz
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build and upload artifacts to Release

on:
release:
types: [published]


jobs:
fedora40-build:
name: Fedora 40 Build
uses: ./.github/workflows/build-umu-fedora-40.yml
fedora40-release:
name: Fedora 40 Release ${{ github.ref_name }}
needs: fedora40-build
uses: ./.github/workflows/build-umu-publish-release.yml
with:
version: ${{ github.ref_name }}
file1: umu-launcher-${{ github.ref_name }}.fc40.noarch.rpm
name1: umu-launcher-${{ github.ref_name }}.fc40.noarch.rpm

fedora41-build:
name: Fedora 41 Build
uses: ./.github/workflows/build-umu-fedora-41.yml
fedora41-release:
name: Fedora 41 Release ${{ github.ref_name }}
needs: fedora41-build
uses: ./.github/workflows/build-umu-publish-release.yml
with:
version: ${{ github.ref_name }}
file1: umu-launcher-${{ github.ref_name }}.fc41.noarch.rpm
name1: umu-launcher-${{ github.ref_name }}.fc41.noarch.rpm

debian12-build:
name: Debian 12 Build
uses: ./.github/workflows/build-umu-debian-12.yml
debian12-release:
name: Debian 12 Release ${{ github.ref_name }}
needs: debian12-build
uses: ./.github/workflows/build-umu-publish-release.yml
with:
version: ${{ github.ref_name }}
file1: python3-umu-launcher_${{ github.ref_name }}-1_amd64_debian-12.deb
name1: python3-umu-launcher_${{ github.ref_name }}-1_amd64_debian-12.deb
file2: umu-launcher_${{ github.ref_name }}-1_all_debian-12.deb
name2: umu-launcher_${{ github.ref_name }}-1_all_debian-12.deb

ubuntu-noble-build:
name: Ubuntu 24.04 Build
uses: ./.github/workflows/build-umu-ubuntu-noble.yml
ubuntu-noble-release:
name: Ubuntu 24.04 Release ${{ github.ref_name }}
needs: ubuntu-noble-build
uses: ./.github/workflows/build-umu-publish-release.yml
with:
version: ${{ github.ref_name }}
file1: python3-umu-launcher_${{ github.ref_name }}-1_amd64_ubuntu-noble.deb
name1: python3-umu-launcher_${{ github.ref_name }}-1_amd64_ubuntu-noble.deb
file2: umu-launcher_${{ github.ref_name }}-1_all_ubuntu-noble.deb
name2: umu-launcher_${{ github.ref_name }}-1_all_ubuntu-noble.deb

zipapp-build:
name: Zipapp Build
uses: ./.github/workflows/build-umu-zipapp.yml
zipapp-release:
name: Zippapp Release ${{ github.ref_name }}
needs: zipapp-build
uses: ./.github/workflows/build-umu-publish-release.yml
with:
version: ${{ github.ref_name }}
file1: umu-launcher-${{ github.ref_name }}-zipapp.tar.gz
name1: umu-launcher-${{ github.ref_name }}-zipapp.tar.gz

0 comments on commit 0471d14

Please sign in to comment.