Skip to content

Commit

Permalink
test publish
Browse files Browse the repository at this point in the history
  • Loading branch information
crohr committed May 30, 2024
1 parent b3abcf4 commit f0b3bbc
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ jobs:
matrix:
target:
- debian:10
- debian:11
- debian:12
- ubuntu:20.04
- ubuntu:22.04
- ubuntu:24.04
- el:7
- el:8
- el:9
- sles:12
- sles:15
# - debian:11
# - debian:12
# - ubuntu:20.04
# - ubuntu:22.04
# - ubuntu:24.04
# - el:7
# - el:8
# - el:9
# - sles:12
# - sles:15

steps:
- uses: actions/checkout@v4
Expand All @@ -41,4 +41,12 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package.outputs.package_name }}
path: ${{ steps.package.outputs.package_path }}
path: ${{ steps.package.outputs.package_path }}
- name: Publish
uses: ./action/publish
with:
token: ${{ secrets.PUBLISH_TOKEN }}
repository: crohr/blank-sinatra-app
target: ${{ matrix.target }}
branch: master
artefact: ${{ steps.package.outputs.package_path }}
43 changes: 43 additions & 0 deletions publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'pkgr/action/publish'
description: 'Publish your package to the packagehall'
inputs:
artefact:
description: 'Artefact to publish'
required: true
target:
description: 'Distribution'
required: true
repository:
description: 'Repository to publish to'
required: true
default: '${{ github.repository }}'
channel:
description: 'Channel to publish to'
required: true
default: 'master'
token:
description: 'Token to use for authentication'
required: true

outputs:
id:
description: "Package identifier"
value: ${{ steps.upload.outputs.id }}

runs:
using: "composite"
steps:
- name: Upload
id: upload
shell: bash
env:
GITHUB_REPOSITORY: ${{ inputs.repository }}
TARGET: ${{ inputs.target }}
CHANNEL: ${{ inputs.channel }}
run: |
org=${GITHUB_REPOSITORY%%/*}
repo=${GITHUB_REPOSITORY##*/}
curl -u "${{ inputs.token }}" -i -X POST https://packagehall.com/api/orgs/${org}/repos/${repo}/packages \
-F "package[artefact]=@${{ inputs.artefact }}" \
-F "package[target]=${TARGET/://}" \
-F "package[channel]=$CHANNEL"

0 comments on commit f0b3bbc

Please sign in to comment.