meshtasticd-debian: Auto-Publish to OBS (#5791)

This commit is contained in:
Austin 2025-01-10 20:03:29 -05:00 committed by GitHub
parent f18a92e8c5
commit b62bdbc46a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 77 additions and 44 deletions

View File

@ -137,6 +137,13 @@ jobs:
package-native: package-native:
uses: ./.github/workflows/package_amd64.yml uses: ./.github/workflows/package_amd64.yml
build-debian-src:
uses: ./.github/workflows/build_debian_src.yml
with:
series: UNRELEASED
build_location: local
secrets: inherit
test-native: test-native:
uses: ./.github/workflows/test_native.yml uses: ./.github/workflows/test_native.yml
@ -260,6 +267,7 @@ jobs:
package-raspbian, package-raspbian,
package-raspbian-armv7l, package-raspbian-armv7l,
package-native, package-native,
build-debian-src,
] ]
steps: steps:
- name: Checkout - name: Checkout
@ -271,8 +279,12 @@ jobs:
python-version: 3.x python-version: 3.x
- name: Get release version string - name: Get release version string
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT run: |
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
id: version id: version
env:
BUILD_LOCATION: local
- name: Create release - name: Create release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
@ -292,6 +304,17 @@ jobs:
merge-multiple: true merge-multiple: true
path: ./output path: ./output
- name: Download source deb
uses: actions/download-artifact@v4
with:
pattern: firmware-debian-${{ steps.version.outputs.deb }}~UNRELEASED-src
merge-multiple: true
path: ./output/debian-src
- name: Zip source deb
working-directory: output
run: zip -j -9 -r ./meshtasticd-${{ steps.version.outputs.deb }}-src.zip ./debian-src
# For diagnostics # For diagnostics
- name: Display structure of downloaded files - name: Display structure of downloaded files
run: ls -lR run: ls -lR
@ -304,6 +327,7 @@ jobs:
./output/meshtasticd_${{ steps.version.outputs.long }}_arm64.deb ./output/meshtasticd_${{ steps.version.outputs.long }}_arm64.deb
./output/meshtasticd_${{ steps.version.outputs.long }}_armhf.deb ./output/meshtasticd_${{ steps.version.outputs.long }}_armhf.deb
./output/meshtasticd_${{ steps.version.outputs.long }}_amd64.deb ./output/meshtasticd_${{ steps.version.outputs.long }}_amd64.deb
./output/meshtasticd-${{ steps.version.outputs.deb }}-src.zip
- name: Bump version.properties - name: Bump version.properties
run: >- run: >-

View File

@ -25,13 +25,13 @@ jobs:
series: [plucky, oracular, noble, jammy] series: [plucky, oracular, noble, jammy]
uses: ./.github/workflows/package_ppa.yml uses: ./.github/workflows/package_ppa.yml
with: with:
ppa_repo: daily ppa_repo: ppa:meshtastic/daily
series: ${{ matrix.series }} series: ${{ matrix.series }}
secrets: inherit secrets: inherit
package-obs: package-obs:
uses: ./.github/workflows/package_obs.yml uses: ./.github/workflows/package_obs.yml
with: with:
obs_repo: meshtasticd obs_project: home:meshtastic:daily
series: unstable series: unstable
secrets: inherit secrets: inherit

View File

@ -3,11 +3,15 @@ name: Package for OpenSUSE Build Service
on: on:
workflow_call: workflow_call:
secrets: secrets:
OBS_USERNAME:
required: true
OBS_PASSWORD:
required: true
PPA_GPG_PRIVATE_KEY: PPA_GPG_PRIVATE_KEY:
required: true required: true
inputs: inputs:
obs_repo: obs_project:
description: Meshtastic OBS repo to target description: Meshtastic OBS project to target
required: true required: true
type: string type: string
series: series:
@ -64,40 +68,43 @@ jobs:
- name: Display structure of downloaded files - name: Display structure of downloaded files
run: ls -lah run: ls -lah
# - name: Configure osc - name: Configure osc
# shell: bash run: |
# env: # Setup OpenSUSE Build Service credentials
# OBS_USERNAME: ${{ secrets.OBS_USERNAME }} mkdir -p ~/.config/osc
# OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} echo "[general]" > ~/.config/osc/oscrc
# run: | echo "apiurl=https://api.opensuse.org" >> ~/.config/osc/oscrc
# mkdir -p ~/.config/osc echo "[https://api.opensuse.org]" >> ~/.config/osc/oscrc
# echo -e "[https://api.opensuse.org]\n" > ~/.config/osc/oscrc echo "user=${{ secrets.OBS_USERNAME }}" >> ~/.config/osc/oscrc
# echo -e "user = $OBS_USERNAME" >> ~/.config/osc/oscrc echo "pass=${{ secrets.OBS_PASSWORD }}" >> ~/.config/osc/oscrc
# echo -e "pass = $OBS_PASSWORD" >> ~/.config/osc/oscrc echo "credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager" >> ~/.config/osc/oscrc
# echo -e "aliases = obs" >> ~/.config/osc/oscrc # Create a temporary directory for osc checkout
# # Authenticate to OBS mkdir -p osc
# osc meta prj -v
# - name: Upload Package to OBS # Intentionally fail if credentials are invalid
# shell: bash # Update secrets if this returns `401`
# run: | - name: Verify OBS authentication
# # Define your OBS project and repository run: osc token
# OBS_PROJECT="application:meshtastic"
# OBS_REPO="${{ inputs.obs_repo }}"
# # Create a temporary directory for osc - name: Upload package to OBS
# mkdir -p /tmp/osc/$OBS_PROJECT/$OBS_REPO shell: bash
# cd /tmp/osc/$OBS_PROJECT/$OBS_REPO working-directory: osc
env:
OBS_PROJECT: ${{ inputs.obs_project }}
OBS_PACKAGE: meshtasticd
run: |
# Initialize the package in the current directory
osc checkout --output-dir . $OBS_PROJECT $OBS_PACKAGE
# # Initialize the package directory # Remove the existing package files
# osc checkout $OBS_PROJECT $OBS_REPO rm -rf *.dsc *.tar.xz
# # Copy package files to the osc directory # Copy new package files to the directory
# cp $GITHUB_WORKSPACE/*.dsc . cp $GITHUB_WORKSPACE/*.dsc .
# cp $GITHUB_WORKSPACE/*.tar.xz . cp $GITHUB_WORKSPACE/*.tar.xz .
# # Add files to osc # Add/Remove the files
# osc addremove osc addremove
# # Commit and push the changes # Commit changes and push to OpenSUSE Build Service
# osc commit -m "Automated upload from GitHub Actions" osc commit -m "GitHub Actions: ${{ steps.version.outputs.deb }}~${{ inputs.series }}"

View File

@ -71,4 +71,4 @@ jobs:
- name: Publish with dput - name: Publish with dput
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
run: | run: |
dput ppa:meshtastic/${{ inputs.ppa_repo }} meshtasticd_${{ steps.version.outputs.deb }}~${{ inputs.series }}_source.changes dput ${{ inputs.ppa_repo }} meshtasticd_${{ steps.version.outputs.deb }}~${{ inputs.series }}_source.changes

View File

@ -15,13 +15,15 @@ jobs:
uses: ./.github/workflows/package_ppa.yml uses: ./.github/workflows/package_ppa.yml
with: with:
ppa_repo: |- ppa_repo: |-
${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} ppa:meshtastic/${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
series: ${{ matrix.series }} series: ${{ matrix.series }}
secrets: inherit secrets: inherit
# package-obs: package-obs:
# uses: ./.github/workflows/package_obs.yml uses: ./.github/workflows/package_obs.yml
# with: with:
# obs_repo: meshtasticd obs_project: |-
# series: ${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} home:meshtastic:${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
# secrets: inherit series: |-
${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
secrets: inherit