Skip to content

Commit f96ce4b

Browse files
committed
use working-directory, this should simplify a bit the workflow
1 parent e1af8bd commit f96ce4b

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.github/workflows/publish-go-nightly-task.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,20 @@ jobs:
126126
127127
- name: Re-package binary and output checksum
128128
id: re-package
129+
working-directory: ${{ env.DIST_DIR }}
129130
# This step performs the following:
130131
# 1. Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
131132
# 2. Recalculate package checksum
132133
# 3. Output the new checksum to include in the nnnnnn-checksums.txt file(it cannot be done there because of parallelization)
133134
run: |
134135
# GitHub's upload/download-artifact@v2 actions don't preserve file permissions,
135136
# so we need to add execution permission back until the action is made to do this.
136-
chmod +x "${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
137-
PACKAGE_FILENAME="$(basename ${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_nightly-*${{ matrix.artifact.path }})"
138-
tar -czvf "${{ env.DIST_DIR }}/$PACKAGE_FILENAME" \
139-
-C "${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
137+
chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
138+
PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_nightly-*${{ matrix.artifact.path }}"
139+
tar -czvf "$PACKAGE_FILENAME" \
140+
-C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
140141
-C ../../ LICENSE.txt
141-
CHECKSUM_LINE="$(shasum -a 256 ${{ env.DIST_DIR }}/$PACKAGE_FILENAME)"
142+
CHECKSUM_LINE="$(shasum -a 256 $PACKAGE_FILENAME)"
142143
echo "::set-output name=checksum-${{ matrix.artifact.name }}::$CHECKSUM_LINE"
143144
144145
- name: Upload artifacts

.github/workflows/release-go-task.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,21 @@ jobs:
131131
132132
- name: Re-package binary and output checksum
133133
id: re-package
134+
working-directory: ${{ env.DIST_DIR }}
134135
# This step performs the following:
135136
# 1. Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
136137
# 2. Recalculate package checksum
137138
# 3. Output the new checksum to include in the nnnnnn-checksums.txt file(it cannot be done there because of parallelization)
138139
run: |
139140
# GitHub's upload/download-artifact@v2 actions don't preserve file permissions,
140141
# so we need to add execution permission back until the action is made to do this.
141-
chmod +x "${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
142+
chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
142143
TAG="${GITHUB_REF/refs\/tags\//}"
143-
PACKAGE_FILENAME="$(basename ${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.artifact.path }})"
144-
tar -czvf "${{ env.DIST_DIR }}/$PACKAGE_FILENAME" \
145-
-C "${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
144+
PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.artifact.path }}"
145+
tar -czvf "$PACKAGE_FILENAME" \
146+
-C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
146147
-C ../../ LICENSE.txt
147-
CHECKSUM_LINE="$(shasum -a 256 ${{ env.DIST_DIR }}/$PACKAGE_FILENAME)"
148+
CHECKSUM_LINE="$(shasum -a 256 $PACKAGE_FILENAME)"
148149
echo "::set-output name=checksum-${{ matrix.artifact.name }}::$CHECKSUM_LINE"
149150
150151
- name: Upload artifacts

0 commit comments

Comments
 (0)