56 lines
2.9 KiB
YAML
56 lines
2.9 KiB
YAML
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref_name:
|
|
description: 'Tag or commit'
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
build-tarball:
|
|
name: Build tarball
|
|
runs-on: x86_64
|
|
container:
|
|
image: alpine:latest
|
|
steps:
|
|
- name: Environment setup
|
|
run: apk add nodejs git xz gzip dotnet6-sdk dotnet7-sdk sed bash
|
|
- name: Repo pull
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 500
|
|
ref: ${{ inputs.ref_name }}
|
|
- name: Package build
|
|
run: |
|
|
sed 's|<Exec Command="tar.*|<Exec Command="tar -cf $(TarballFilePath) -C $(TarballDir)/.. $([MSBuild]::MakeRelative($([System.IO.Path]::GetDirectoryName($(TarballDir))), $(TarballDir)))" />|' -i src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets
|
|
export _cli_root=/usr/lib/dotnet
|
|
echo "Building dotnet-${{ inputs.ref_name }} tarball"
|
|
_InitializeDotNetCli="$_cli_root" DOTNET_INSTALL_DIR="$_cli_root" DotNetBuildFromSource=true ./build.sh /p:ArcadeBuildTarball=true /p:EnableSourceLink=false /p:CheckEolTargetFramework=false /p:TarballDir=$(pwd)/dotnet-${{ inputs.ref_name }} /p:TarballFilePath=$(pwd)/dotnet-${{ inputs.ref_name }}.tar
|
|
echo "Compressing dotnet-${{ inputs.ref_name }}.tar.xz"
|
|
xz -T0 -9 -vv -e -c > ./dotnet-${{ inputs.ref_name }}.tar.xz < ./dotnet-${{ inputs.ref_name }}.tar
|
|
echo "Generating sha512sum and sha256sum"
|
|
sha512sum dotnet-${{ inputs.ref_name }}.tar.xz > dotnet-${{ inputs.ref_name }}.tar.xz.sha512sum
|
|
sha256sum dotnet-${{ inputs.ref_name }}.tar.xz > dotnet-${{ inputs.ref_name }}.tar.xz.sha256sum
|
|
- name: Package upload
|
|
uses: forgejo/upload-artifact@v3
|
|
with:
|
|
name: tarball
|
|
path: dotnet*.tar.*
|
|
retention-days: 1 day
|
|
upload-tarball:
|
|
name: Upload to generic repo
|
|
runs-on: x86_64
|
|
needs: [build-tarball]
|
|
container:
|
|
image: alpine:latest
|
|
steps:
|
|
- name: Environment setup
|
|
run: apk add nodejs curl findutils
|
|
- name: Package download
|
|
uses: forgejo/download-artifact@v3
|
|
- name: Package deployment
|
|
run: |
|
|
find .
|
|
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file ./tarball/dotnet-*.tar.xz ${{ github.server_url }}/api/packages/mirrors/generic/dotnet/${{ inputs.ref_name }}/dotnet-${{ inputs.ref_name}}.tar.xz
|
|
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file ./tarball/dotnet-*.tar.xz.sha512sum ${{ github.server_url }}/api/packages/mirrors/generic/dotnet/${{ inputs.ref_name }}/dotnet-${{ inputs.ref_name}}.tar.xz.sha512sum
|
|
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file ./tarball/dotnet-*.tar.xz.sha256sum ${{ github.server_url }}/api/packages/mirrors/generic/dotnet/${{ inputs.ref_name }}/dotnet-${{ inputs.ref_name}}.tar.xz.sha256sum
|