@@ -4,6 +4,14 @@ pipeline {
44 ansiColor(' xterm' )
55 }
66
7+ environment {
8+ GITHUB_TOKEN = credentials(' github-token-pixelc-linux' )
9+ GITHUB_ORGANIZATION = " pixelc-linux"
10+ GITHUB_REPO = " arch-linux-releases"
11+ DISTRO = " Arch"
12+ DISTRO_D = " arch"
13+ }
14+
715 stages {
816 stage(' Checkout' ) {
917 steps {
@@ -14,17 +22,32 @@ pipeline {
1422 stage(' Build' ) {
1523 steps {
1624 dir(' rootfs-builder' ) {
17- withDockerContainer(image : ' dvitali/pixelc-build-container:5 ' , args : ' --privileged' ) {
18- sh ' bash -c "mkdir -p out/{arch,ubuntu }/rootfs"'
19- sh ' UID=0 GID=0 DISTRO=arch SYSROOT=$(pwd)/out/$DISTRO/rootfs TOP=$(pwd) ./build.sh'
25+ withDockerContainer(image : ' dvitali/pixelc-build-container:7 ' , args : ' --privileged' ) {
26+ sh ' bash -c "mkdir -p out/${DISTRO_D }/rootfs"'
27+ sh ' UID=0 GID=0 DISTRO=${DISTRO_D} SYSROOT=$(pwd)/out/$DISTRO/rootfs TOP=$(pwd) ./build.sh'
2028 }
2129 }
2230 }
2331 }
2432
2533 stage(' Publish' ) {
2634 steps {
35+ script {
36+ env. VERSION_NAME = sh(returnStdout : true , script : ' cat VERSION_NAME' ). trim()
37+ }
2738 archiveArtifacts ' rootfs-builder/out/*_rootfs.tar.gz'
39+ withDockerContainer(image : ' dvitali/pixelc-build-container:7' ){
40+ sh " . /etc/environment"
41+ sh " echo $PATH "
42+ echo " Deleting release from github before creating new one"
43+ sh " /opt/go/bin/github-release delete --user ${ GITHUB_ORGANIZATION} --repo ${ GITHUB_REPO} --tag ${ env.VERSION_NAME} "
44+
45+ echo " Creating a new release in github"
46+ sh " /opt/go/bin/github-release release --user ${ GITHUB_ORGANIZATION} --repo ${ GITHUB_REPO} --tag ${ env.VERSION_NAME} --name ${ VERSION_NAME} "
47+
48+ echo " Uploading the artifacts into github"
49+ sh " /opt/go/bin/github-release upload --user ${ GITHUB_ORGANIZATION} --repo ${ GITHUB_REPO} --tag ${ env.VERSION_NAME} --name ${ DISTRO} -${ VERSION_NAME} _rootfs.tar.gz --file rootfs-builder/out/${ DISTRO_D} _rootfs.tar.gz"
50+ }
2851 }
2952 }
3053 }
0 commit comments