Initial commit
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Publish skydust app
|
||||||
|
|
||||||
|
Used to publish binaries to be packaged in docker images but can also be used to publish anything.
|
||||||
49
action.yml
Normal file
49
action.yml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
name: Publish Skydust App
|
||||||
|
description: Uses generic packages to publish apps
|
||||||
|
author: Skydust
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
appName:
|
||||||
|
description: "The app name to publish"
|
||||||
|
required: true
|
||||||
|
version:
|
||||||
|
description: "The version to publish (defaults to NEW_VERSION env)"
|
||||||
|
required: false
|
||||||
|
default: "${NEW_VERSION}"
|
||||||
|
publishFolder:
|
||||||
|
description: "Folder to tar, gz and publish"
|
||||||
|
required: true
|
||||||
|
default: "dist/"
|
||||||
|
customArchiveName:
|
||||||
|
description: "Custom archive name, useful for multi-arch"
|
||||||
|
required: false
|
||||||
|
default: "package"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Packaging App
|
||||||
|
run: |
|
||||||
|
log_info "Packaging app into $(yellow)${{ inputs.customArchiveName }}"
|
||||||
|
tar -zcf "${{ inputs.customArchiveName }}.tar.gz" "${{ inputs.publishFolder }}"
|
||||||
|
- name: Publishing App
|
||||||
|
run: |
|
||||||
|
PKG_URL="${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/${{ inputs.appName }}/${{ inputs.version }}/${{ inputs.customArchiveName }}.tar.gz"
|
||||||
|
log_info "Sending package in $(yellow)${PKG_URL}"
|
||||||
|
|
||||||
|
curl --user "MilaBot:${{ secrets.CI_TOKEN }}" \
|
||||||
|
--upload-file "${{ inputs.customArchiveName }}.tar.gz" \
|
||||||
|
"${PKG_URL}" \
|
||||||
|
--verbose \
|
||||||
|
--show-error \
|
||||||
|
--fail
|
||||||
|
|
||||||
|
PKG_SHA="$(sha256sum "${{ inputs.customArchiveName }}.tar.gz" | cut -d' ' -f1 | tr -d '\n')"
|
||||||
|
log_info "Exporting package sha256 hash in env var $(yellow)PKG_SHA"
|
||||||
|
echo "PKG_SHA=${PKG_SHA}" >> $GITEA_ENV@
|
||||||
|
|
||||||
|
log_info "Exporting package url in env var $(yellow)PKG_URL"
|
||||||
|
echo "PKG_URL=${PKG_URL}" >> $GITEA_ENV
|
||||||
|
|
||||||
|
log_info "Cleaning up"
|
||||||
|
rm -f "${{ inputs.customArchiveName }}.tar.gz"
|
||||||
Reference in New Issue
Block a user