54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
name: Upload linux package to artifact
|
|
|
|
inputs:
|
|
platform:
|
|
required: true
|
|
type: string
|
|
platform-name:
|
|
required: true
|
|
type: string
|
|
docker-image-name:
|
|
required: true
|
|
type: string
|
|
docker-version:
|
|
required: true
|
|
type: string
|
|
docker-username:
|
|
required: true
|
|
type: string
|
|
docker-password:
|
|
required: true
|
|
type: string
|
|
package-file-name-prefix:
|
|
required: true
|
|
type: string
|
|
package-artifact-name-prefix:
|
|
required: true
|
|
type: string
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Login to DockerHub
|
|
if: ${{ inputs.docker-username != '' && inputs.docker-password != '' }}
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ inputs.docker-username }}
|
|
password: ${{ inputs.docker-password }}
|
|
|
|
- name: Pull and save packaged files for ${{ inputs.platform-name }}
|
|
shell: bash
|
|
run: |
|
|
docker pull --platform ${{ inputs.platform }} ${{ inputs.docker-image-name }}:${{ inputs.docker-version }}
|
|
containerid=$(docker create "${{ inputs.docker-image-name }}:${{ inputs.docker-version }}")
|
|
docker cp ${containerid}:/ezbookkeeping ./ezbookkeeping
|
|
cd ezbookkeeping
|
|
tar -czf ../${{ inputs.package-file-name-prefix }}-${{ inputs.platform-name }}.tar.gz *
|
|
|
|
- name: Upload artifact for ${{ inputs.platform-name }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ inputs.package-artifact-name-prefix }}-${{ inputs.platform-name }}
|
|
path: ${{ inputs.package-file-name-prefix }}-${{ inputs.platform-name }}.tar.gz
|
|
if-no-files-found: error
|