Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise workflows to automatically upload artifacts on new releases #276

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
37 changes: 25 additions & 12 deletions .github/workflows/build-umu-debian-12.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: UMU Deb Build - Debian 12
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]
workflow_call:
inputs:
version:
required: true
type: string


jobs:
build:
Expand All @@ -29,19 +29,32 @@ 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: |
sed -re 's|(umu-launcher \()[1-9.]+(-1\).*$)|\1${{ inputs.version }}\2|' -i ./debian/changelog
LOGNAME=root dh_make --createorig -y -l -p umu-launcher_${{ inputs.version }} || 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_${{ inputs.version }}-1_amd64.deb \
results/python3-umu-launcher_${{ inputs.version }}-1_amd64_debian-12.deb
mv ../umu-launcher_${{ inputs.version }}-1_all.deb \
results/umu-launcher_${{ inputs.version }}-1_all_debian-12.deb

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: python3-umu-launcher_${{ inputs.version }}-1_amd64_debian-12.deb
path: results/python3-umu-launcher_${{ inputs.version }}-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_${{ inputs.version }}-1_all_debian-12.deb
path: results/umu-launcher_${{ inputs.version }}-1_all_debian-12.deb
28 changes: 18 additions & 10 deletions .github/workflows/build-umu-fedora-40.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
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:
inputs:
version:
required: true
type: string
shasum:
required: true
type: string


jobs:
build:
Expand All @@ -33,10 +36,15 @@ jobs:
make
mkdir -p ~/rpmbuild/SOURCES
cp -r . ~/rpmbuild/SOURCES/umu-launcher
sed -re 's|(Version:\s+)[1-9.]+|\1${{ inputs.version }}|g' -i packaging/rpm/umu-launcher.spec
sed -re 's|(%define tag\s+)[1-9.]+|\1${{ inputs.version }}|g' -i packaging/rpm/umu-launcher.spec
sed -re 's|(%define manual_commit\s+)\w+|\1${{ inputs.shasum }}|g' -i packaging/rpm/umu-launcher.spec
rpmbuild -ba packaging/rpm/umu-launcher.spec
mv ~/rpmbuild/RPMS/noarch/umu-launcher-${{ inputs.version }}*.rpm \
~/rpmbuild/RPMS/noarch/umu-launcher-${{ inputs.version }}.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-${{ inputs.version }}.fc40.noarch.rpm
path: ~/rpmbuild/RPMS/noarch/umu-launcher-${{ inputs.version }}.fc40.noarch.rpm
28 changes: 18 additions & 10 deletions .github/workflows/build-umu-fedora-41.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
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:
inputs:
version:
required: true
type: string
shasum:
required: true
type: string


jobs:
build:
Expand All @@ -33,10 +36,15 @@ jobs:
make
mkdir -p ~/rpmbuild/SOURCES
cp -r . ~/rpmbuild/SOURCES/umu-launcher
sed -re 's|(Version:\s+)[1-9.]+|\1${{ inputs.version }}|g' -i packaging/rpm/umu-launcher.spec
sed -re 's|(%define tag\s+)[1-9.]+|\1${{ inputs.version }}|g' -i packaging/rpm/umu-launcher.spec
sed -re 's|(%define manual_commit\s+)\w+|\1${{ inputs.shasum }}|g' -i packaging/rpm/umu-launcher.spec
rpmbuild -ba packaging/rpm/umu-launcher.spec
mv ~/rpmbuild/RPMS/noarch/umu-launcher-${{ inputs.version }}*.rpm \
~/rpmbuild/RPMS/noarch/umu-launcher-${{ inputs.version }}.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-${{ inputs.version }}.fc41.noarch.rpm
path: ~/rpmbuild/RPMS/noarch/umu-launcher-${{ inputs.version }}.fc41.noarch.rpm
48 changes: 48 additions & 0 deletions .github/workflows/build-umu-publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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
37 changes: 25 additions & 12 deletions .github/workflows/build-umu-ubuntu-noble.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: UMU Deb Build - Noble (Ubuntu 24.04 LTS)
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]
workflow_call:
inputs:
version:
required: true
type: string


jobs:
build:
Expand All @@ -29,19 +29,32 @@ 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: |
sed -re 's|(umu-launcher \()[1-9.]+(-1\).*$)|\1${{ inputs.version }}\2|' -i ./debian/changelog
LOGNAME=root dh_make --createorig -y -l -p umu-launcher_${{ inputs.version }} || 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_${{ inputs.version }}-1_amd64.deb \
results/python3-umu-launcher_${{ inputs.version }}-1_amd64_ubuntu-noble.deb
mv ../umu-launcher_${{ inputs.version }}-1_all.deb \
results/umu-launcher_${{ inputs.version }}-1_all_ubuntu-noble.deb

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: python3-umu-launcher_${{ inputs.version }}-1_amd64_ubuntu-noble.deb
path: results/python3-umu-launcher_${{ inputs.version }}-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_${{ inputs.version }}-1_all_ubuntu-noble.deb
path: results/umu-launcher_${{ inputs.version }}-1_all_ubuntu-noble.deb
35 changes: 35 additions & 0 deletions .github/workflows/build-umu-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: UMU Describe Version

on:
workflow_call:
outputs:
version:
value: "${{ jobs.version.outputs.tag_abbrev }}.${{ jobs.version.outputs.tag_offset }}"
branch:
value: "${{ jobs.version.outputs.branch }}"


jobs:
version:
name: Version
runs-on: ubuntu-latest
outputs:
tag_abbrev: ${{ steps.describe.outputs.tag_abbrev }}
tag_offset: ${{ steps.describe.outputs.tag_offset }}
sha_short: ${{ steps.describe.outputs.sha_short }}
full_desc: ${{ steps.describe.outputs.full_desc }}
branch: ${{ steps.describe.outputs.branch }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Describe
id: describe
shell: bash
run: |
tag_abbrev=$(git tag --sort=v:refname | grep -oE "(^[0-9]+\.[0-9]+(.[0-9]+)?)$" | tail -1)
echo "tag_abbrev=$tag_abbrev" >> $GITHUB_OUTPUT
echo "tag_offset=$(git rev-list $tag_abbrev..HEAD --count)" >> $GITHUB_OUTPUT
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "full_desc=$(git describe --long --tags)" >> $GITHUB_OUTPUT
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
19 changes: 9 additions & 10 deletions .github/workflows/build-umu-zipapp.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: UMU Zipapp Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]
workflow_call:
inputs:
version:
required: true
type: string

jobs:
build:
Expand Down Expand Up @@ -37,10 +36,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-${{ inputs.version }}-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-${{ inputs.version }}-zipapp.tar.gz
path: results/umu-launcher-${{ inputs.version }}-zipapp.tar.gz
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and upload development artifacts

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

jobs:
version:
name: Describe
uses: ./.github/workflows/build-umu-version.yml

fedora40-build:
name: Fedora 40 Build
uses: ./.github/workflows/build-umu-fedora-40.yml
needs: version
with:
version: ${{ needs.version.outputs.version }}
shasum: ${{ github.sha }}

fedora41-build:
name: Fedora 41 Build
uses: ./.github/workflows/build-umu-fedora-41.yml
needs: version
with:
version: ${{ needs.version.outputs.version }}
shasum: ${{ github.sha }}

debian12-build:
name: Debian 12 Build
uses: ./.github/workflows/build-umu-debian-12.yml
needs: version
with:
version: ${{ needs.version.outputs.version }}

ubuntu-noble-build:
name: Ubuntu 24.04 Build
uses: ./.github/workflows/build-umu-ubuntu-noble.yml
needs: version
with:
version: ${{ needs.version.outputs.version }}

zipapp-build:
name: Zipapp Build
uses: ./.github/workflows/build-umu-zipapp.yml
needs: version
with:
version: ${{ needs.version.outputs.version }}

Loading
Loading