From 6e17d8ea018d2f4514d3df4854ecff0cf35e6a2e Mon Sep 17 00:00:00 2001 From: Don Hardman Date: Fri, 20 Oct 2023 17:53:11 +0700 Subject: [PATCH] Fix date and commit difference in built packages --- .github/workflows/release.yml | 43 +++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1b44a9..0a495fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,29 @@ env: COLUMNAR_VERSION: '2.2.1' jobs: + vars: + runs-on: ubuntu-22.04 + outputs: + app_version: ${{ steps.vars.outputs.app_version }} + app_date: ${{ steps.vars.outputs.app_date }} + app_commit: ${{ steps.vars.outputs.app_commit }} + rpm_suffix: ${{ steps.vars.outputs.rpm_suffix }} + deb_suffix: ${{ steps.vars.outputs.deb_suffix }} + + steps: + - uses: actions/checkout@v3 + - id: vars + run: | + version=$(> $GITHUB_OUTPUT + echo "app_date=$date" >> $GITHUB_OUTPUT + echo "app_commit=$commit" >> $GITHUB_OUTPUT + echo "rpm_suffix=_${date}.$commit" >> $GITHUB_OUTPUT + echo "deb_suffix=-${date}-$commit" >> $GITHUB_OUTPUT + build-artifact: runs-on: ${{ matrix.os }} strategy: @@ -37,11 +60,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - id: vars - run: | - echo "app_version=$(echo ${{ github.ref_name }} | cut -dv -f2)" >> $GITHUB_OUTPUT - echo "rpm_suffix=_$( date +%y%m%d%H ).${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT - echo "deb_suffix=-$( date +%y%m%d%H )-${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT - name: Set up QEMU if: ${{ matrix.use_buildx == true }} uses: docker/setup-qemu-action@v2 @@ -104,11 +122,6 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - id: vars - run: | - echo "app_version=$(echo ${{ github.ref_name }} | cut -dv -f2)" >> $GITHUB_OUTPUT - echo "rpm_suffix=_$( date +%y%m%d%H ).${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT - echo "deb_suffix=-$( date +%y%m%d%H )-${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT - name: Download artifact uses: manticoresoftware/download_artifact_with_retries@main with: @@ -213,11 +226,6 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - id: vars - run: | - echo "app_version=$(echo ${{ github.ref_name }} | cut -dv -f2)" >> $GITHUB_OUTPUT - echo "rpm_suffix=_$( date +%y%m%d%H ).${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT - echo "deb_suffix=-$( date +%y%m%d%H )-${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT - name: Download artifact uses: manticoresoftware/download_artifact_with_retries@main with: @@ -329,11 +337,6 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - id: vars - run: | - echo "app_version=$(echo ${{ github.ref_name }} | cut -dv -f2)" >> $GITHUB_OUTPUT - echo "rpm_suffix=_$( date +%y%m%d%H ).${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT - echo "deb_suffix=-$( date +%y%m%d%H )-${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT - name: Prepare packages structure run: | mkdir -p .debpkg/usr/bin