diff options
Diffstat (limited to '.github/workflows/release-build.yaml')
-rw-r--r-- | .github/workflows/release-build.yaml | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/.github/workflows/release-build.yaml b/.github/workflows/release-build.yaml index 9d54cb5..87a783b 100644 --- a/.github/workflows/release-build.yaml +++ b/.github/workflows/release-build.yaml @@ -24,6 +24,10 @@ jobs: - arm64 - armhf steps: + - name: "Set dated version for unstable builds" + id: version + run: if [[ ${{ inputs.version }} == "master" ]]; then echo "::set-output name=version::$(date +'%Y%m%d%H')"; else echo "::set-output name=version::${{ inputs.version }}"; fi + - name: "Install dependencies" run: |- sudo apt-get install --yes python3-git @@ -37,7 +41,7 @@ jobs: - name: "Run builder for ${{ matrix.version }} ${{ matrix.arch }}" run: |- - sudo ./build.py ${{ inputs.version }} debian ${{ matrix.arch }} ${{ matrix.release }} + sudo ./build.py ${{ steps.version.outputs.version }} debian ${{ matrix.arch }} ${{ matrix.release }} - name: "Upload artifacts to repository server" uses: appleboy/scp-action@v0.1.7 @@ -47,7 +51,7 @@ jobs: key: "${{ secrets.REPO_KEY }}" source: "out/debian/*" strip_components: 2 - target: "/srv/incoming/${{ inputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}" + target: "/srv/incoming/${{ steps.version.outputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}" - name: "Import artifacts into reprepro" uses: appleboy/ssh-action@v1.0.3 @@ -57,13 +61,13 @@ jobs: key: "${{ secrets.REPO_KEY }}" script: | set -o xtrace - if [[ ${{ inputs.version }} == "master" ]]; then + if [[ ${{ steps.version.outputs.version }} != "master" ]]; then COMPONENT="main" else COMPONENT="unstable" fi - sudo reprepro --basedir /srv/debian --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/${{ inputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}/*.deb - sudo reprepro --basedir /srv/debian --component ${COMPONENT} includedsc ${{ matrix.release }} /srv/incoming/${{ inputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}/*.dsc + sudo reprepro --basedir /srv/debian --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/${{ steps.version.outputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}/*.deb + sudo reprepro --basedir /srv/debian --component ${COMPONENT} includedsc ${{ matrix.release }} /srv/incoming/${{ steps.version.outputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}/*.dsc - name: "Move artifacts into repository" uses: appleboy/ssh-action@v1.0.3 @@ -72,10 +76,10 @@ jobs: username: "${{ secrets.REPO_USER }}" key: "${{ secrets.REPO_KEY }}" script: | - sudo mkdir -p /srv/repository/mirror/releases/server/debian/versions/${{ inputs.version }}/${{ matrix.arch }} - sudo mv -t /srv/repository/mirror/releases/server/debian/versions/${{ inputs.version }}/${{ matrix.arch }} /srv/incoming/${{ inputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}/*.deb - if [[ ${{ inputs.version }} != "master" ]]; then - sudo ln -s /srv/repository/mirror/releases/server/debian/versions/${{ inputs.version }}/${{ matrix.arch }} /srv/repository/mirror/releases/server/debian/latest-server + sudo mkdir -p /srv/repository/mirror/releases/server/debian/versions/${{ steps.version.outputs.version }}/${{ matrix.arch }} + sudo mv -t /srv/repository/mirror/releases/server/debian/versions/${{ steps.version.outputs.version }}/${{ matrix.arch }}/ /srv/incoming/${{ steps.version.outputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}/* + if [[ ${{ steps.version.outputs.version }} != "master" ]]; then + sudo ln -s /srv/repository/mirror/releases/server/debian/versions/${{ steps.version.outputs.version }}/${{ matrix.arch }} /srv/repository/mirror/releases/server/debian/latest-server fi Ubuntu: @@ -91,6 +95,10 @@ jobs: - arm64 - armhf steps: + - name: "Set dated version for unstable builds" + id: version + run: if [[ ${{ inputs.version }} == "master" ]]; then echo "::set-output name=version::$(date +'%Y%m%d%H')"; else echo "::set-output name=version::${{ inputs.version }}"; fi + - name: "Install dependencies" run: |- sudo apt-get install --yes python3-git @@ -104,7 +112,7 @@ jobs: - name: "Run builder for ${{ matrix.version }} ${{ matrix.arch }}" run: |- - sudo ./build.py ${{ inputs.version }} ubuntu ${{ matrix.arch }} ${{ matrix.release }} + sudo ./build.py ${{ steps.version.outputs.version }} ubuntu ${{ matrix.arch }} ${{ matrix.release }} - name: "Upload artifacts to repository server" uses: appleboy/scp-action@v0.1.7 @@ -114,7 +122,7 @@ jobs: key: "${{ secrets.REPO_KEY }}" source: "out/ubuntu/*" strip_components: 2 - target: "/srv/incoming/${{ inputs.version }}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}" + target: "/srv/incoming/${{ steps.version.outputs.version }}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}" - name: "Import artifacts into reprepro" uses: appleboy/ssh-action@v1.0.3 @@ -124,13 +132,13 @@ jobs: key: "${{ secrets.REPO_KEY }}" script: | set -o xtrace - if [[ ${{ inputs.version }} == "master" ]]; then + if [[ ${{ steps.version.outputs.version }} != "master" ]]; then COMPONENT="main" else COMPONENT="unstable" fi - sudo reprepro --basedir /srv/ubuntu --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/${{ inputs.version }}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*.deb - sudo reprepro --basedir /srv/ubuntu --component ${COMPONENT} includedsc ${{ matrix.release }} /srv/incoming/${{ inputs.version }}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*.dsc + sudo reprepro --basedir /srv/ubuntu --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/${{ steps.version.outputs.version }}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*.deb + sudo reprepro --basedir /srv/ubuntu --component ${COMPONENT} includedsc ${{ matrix.release }} /srv/incoming/${{ steps.version.outputs.version }}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*.dsc - name: "Move artifacts into repository" uses: appleboy/ssh-action@v1.0.3 @@ -139,9 +147,9 @@ jobs: username: "${{ secrets.REPO_USER }}" key: "${{ secrets.REPO_KEY }}" script: | - sudo mkdir -p /srv/repository/mirror/releases/server/ubuntu/versions/${{ inputs.version }}/${{ matrix.arch }} - sudo mv -t /srv/repository/mirror/releases/server/ubuntu/versions/${{ inputs.version }}/${{ matrix.arch }} /srv/incoming/${{ inputs.version }}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*.deb - if [[ ${{ inputs.version }} != "master" ]]; then - sudo ln -s /srv/repository/mirror/releases/server/ubuntu/versions/${{ inputs.version }}/${{ matrix.arch }} /srv/repository/mirror/releases/server/ubuntu/latest-server + sudo mkdir -p /srv/repository/mirror/releases/server/ubuntu/versions/${{ steps.version.outputs.version }}/${{ matrix.arch }} + sudo mv -t /srv/repository/mirror/releases/server/ubuntu/versions/${{ steps.version.outputs.version }}/${{ matrix.arch }} /srv/incoming/${{ steps.version.outputs.version }}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/* + if [[ ${{ steps.version.outputs.version }} != "master" ]]; then + sudo ln -s /srv/repository/mirror/releases/server/ubuntu/versions/${{ steps.version.outputs.version }}/${{ matrix.arch }} /srv/repository/mirror/releases/server/ubuntu/latest-server fi |