Use environment files instead of outputs

This commit is contained in:
Joshua M. Boniface
2024-02-12 02:18:49 -05:00
parent 7455bb8130
commit 6930e963a1

View File

@@ -26,7 +26,12 @@ jobs:
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
run: |-
if [[ ${{ inputs.version }} == "master" ]]; then
echo "VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV
else
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
fi
- name: "Install dependencies"
run: |-
@@ -41,7 +46,7 @@ jobs:
- name: "Run builder for ${{ matrix.version }} ${{ matrix.arch }}"
run: |-
sudo ./build.py ${{ steps.version.outputs.version }} debian ${{ matrix.arch }} ${{ matrix.release }}
sudo ./build.py ${VERSION} debian ${{ matrix.arch }} ${{ matrix.release }}
- name: "Upload artifacts to repository server"
uses: appleboy/scp-action@v0.1.7
@@ -51,7 +56,7 @@ jobs:
key: "${{ secrets.REPO_KEY }}"
source: "out/debian/*"
strip_components: 2
target: "/srv/incoming/${{ steps.version.outputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}"
target: "/srv/incoming/${VERSION}/debian/${{ matrix.arch }}/${{ matrix.release }}"
- name: "Import artifacts into reprepro"
uses: appleboy/ssh-action@v1.0.3
@@ -66,8 +71,8 @@ jobs:
else
COMPONENT="unstable"
fi
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
sudo reprepro --basedir /srv/debian --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/${VERSION}/debian/${{ matrix.arch }}/${{ matrix.release }}/*.deb
sudo reprepro --basedir /srv/debian --component ${COMPONENT} includedsc ${{ matrix.release }} /srv/incoming/${VERSION}/debian/${{ matrix.arch }}/${{ matrix.release }}/*.dsc
- name: "Move artifacts into repository"
uses: appleboy/ssh-action@v1.0.3
@@ -76,10 +81,10 @@ jobs:
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
script: |
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 }}/*
sudo mkdir -p /srv/repository/mirror/releases/server/debian/versions/${VERSION}/${{ matrix.arch }}
sudo mv -t /srv/repository/mirror/releases/server/debian/versions/${VERSION}/${{ matrix.arch }}/ /srv/incoming/${VERSION}/debian/${{ matrix.arch }}/${{ matrix.release }}/*
if [[ ${{ inputs.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
sudo ln -s /srv/repository/mirror/releases/server/debian/versions/${VERSION}/${{ matrix.arch }} /srv/repository/mirror/releases/server/debian/latest-server
fi
Ubuntu:
@@ -97,7 +102,12 @@ jobs:
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
run: |-
if [[ ${{ inputs.version }} == "master" ]]; then
echo "VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV
else
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
fi
- name: "Install dependencies"
run: |-
@@ -112,7 +122,7 @@ jobs:
- name: "Run builder for ${{ matrix.version }} ${{ matrix.arch }}"
run: |-
sudo ./build.py ${{ steps.version.outputs.version }} ubuntu ${{ matrix.arch }} ${{ matrix.release }}
sudo ./build.py ${VERSION} ubuntu ${{ matrix.arch }} ${{ matrix.release }}
- name: "Upload artifacts to repository server"
uses: appleboy/scp-action@v0.1.7
@@ -122,7 +132,7 @@ jobs:
key: "${{ secrets.REPO_KEY }}"
source: "out/ubuntu/*"
strip_components: 2
target: "/srv/incoming/${{ steps.version.outputs.version }}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}"
target: "/srv/incoming/${VERSION}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}"
- name: "Import artifacts into reprepro"
uses: appleboy/ssh-action@v1.0.3
@@ -137,8 +147,8 @@ jobs:
else
COMPONENT="unstable"
fi
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
sudo reprepro --basedir /srv/ubuntu --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/${VERSION}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*.deb
sudo reprepro --basedir /srv/ubuntu --component ${COMPONENT} includedsc ${{ matrix.release }} /srv/incoming/${VERSION}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*.dsc
- name: "Move artifacts into repository"
uses: appleboy/ssh-action@v1.0.3
@@ -147,9 +157,9 @@ jobs:
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
script: |
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 }}/*
sudo mkdir -p /srv/repository/mirror/releases/server/ubuntu/versions/${VERSION}/${{ matrix.arch }}
sudo mv -t /srv/repository/mirror/releases/server/ubuntu/versions/${VERSION}/${{ matrix.arch }} /srv/incoming/${VERSION}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*
if [[ ${{ inputs.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
sudo ln -s /srv/repository/mirror/releases/server/ubuntu/versions/${VERSION}/${{ matrix.arch }} /srv/repository/mirror/releases/server/ubuntu/latest-server
fi