Skip to content

Commit 4584bea

Browse files
Restore permissions on release
1 parent 15d0fcf commit 4584bea

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

.github/workflows/build-and-release.yaml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
id: version
4343
run: echo "::set-output name=VERSION::$(./dist/OATFWGUI/OATFWGUI.exe --version)"
4444

45+
# Work around stupid issue that GHA can't store file permissions on artifacts
46+
- name: Store which files are executable
47+
run: pushd dist/ && find . -type f -executable -print > restore_executable_permissions.txt && popd
4548
- name: Upload artifact
4649
uses: actions/upload-artifact@v3
4750
with:
@@ -87,6 +90,9 @@ jobs:
8790
id: version
8891
run: echo "::set-output name=VERSION::$(./dist/OATFWGUI_Linux.sh --version | tail -1)"
8992

93+
# Work around stupid issue that GHA can't store file permissions on artifacts
94+
- name: Store which files are executable
95+
run: pushd dist/ && find . -type f -executable -print > restore_executable_permissions.txt && popd
9096
- name: Upload artifact
9197
uses: actions/upload-artifact@v3
9298
with:
@@ -104,16 +110,36 @@ jobs:
104110
uses: actions/download-artifact@v3
105111
with:
106112
path: artifacts
107-
- run: ls -la artifacts
108-
- name: Zip artifacts
113+
- name: Restore executable permissions
109114
run: |
110115
set -e
111116
shopt -s nullglob
117+
PERM_FILE='restore_executable_permissions.txt'
112118
for dir in artifacts/*/; do
113-
out_zip="$(basename $dir).zip"
119+
echo "Entering $dir"
120+
pushd "$dir"
121+
if [ ! -f "$PERM_FILE" ]; then
122+
echo "Could not find permissions file ${PERM_FILE}!"
123+
continue
124+
fi
125+
while IFS= read -r f_path || [ -n "$f_path" ]; do
126+
echo "Restoring execution on $f_path"
127+
chmod +x "$f_path"
128+
done < "$PERM_FILE"
129+
rm "$PERM_FILE"
130+
popd
131+
done
132+
- name: Zip artifacts
133+
run: |
134+
set -e
135+
shopt -s nullglob
136+
pushd artifacts/
137+
for dir in ./*/; do
138+
out_zip="../$(basename $dir).zip"
114139
echo "Zipping $dir into $out_zip"
115-
zip --recurse-paths "$out_zip" "$dir"
140+
zip -8 --recurse-paths "$out_zip" "$dir"
116141
done
142+
popd
117143
- name: Publish GitHub release
118144
uses: softprops/action-gh-release@v1
119145
with:

OATFWGUI/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.0.3'
1+
__version__ = '0.0.4'

0 commit comments

Comments
 (0)