Skip to content

Commit

Permalink
- bring back .github/workflows/run-in-docker.sh
Browse files Browse the repository at this point in the history
- update .github/workflows/pull-transifex.yml to use updated ocstringstool to normalize xcstrings files
  • Loading branch information
felix-schwarz committed Dec 5, 2024
1 parent 27c1c89 commit ea3e01b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/pull-transifex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,30 @@ jobs:
beautifyJSON "ownCloud/Resources/Localizable.xcstrings"
beautifyJSON "ownCloudAppFramework/Resources/Localizable.xcstrings"
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y clang libpython2.7 libpython2.7-dev

- name: Download Swift
run: wget https://swift.org/builds/swift-5.3-release/ubuntu2004/swift-5.3-RELEASE/swift-5.3-RELEASE-ubuntu20.04.tar.gz

- name: Extract Swift
run: tar xzf swift-5.3-RELEASE-ubuntu20.04.tar.gz

- name: Move Swift to /usr/share
run: sudo mv swift-5.3-RELEASE-ubuntu20.04 /usr/share/swift

- name: Add Swift to PATH
run: echo "export PATH=/usr/share/swift/usr/bin:\$PATH" >> $GITHUB_ENV

- name: Verify Swift installation
run: swift -v

- name: Compile Swift file
run: swiftc tools/normalizestrings/main.swift -o ocstringstool

- name: Run compiled Swift program
run: ./ocstringstool normalize "ownCloud/Resources/" "ownCloud Action Extension/" "ownCloud File Provider/" ""ownCloud Share Extension/" "ownCloudAppFramework/Resources/"

- uses: GuillaumeFalourd/[email protected]
with:
email: [email protected]
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/run-in-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#! /bin/bash

image="$1"
shift

commands="$@"

if [[ "$image" == "" ]] || [[ "${commands[@]}" == "" ]]; then
echo "Usage: bash $0 <image> <commands>"
exit 1
fi

set -exo pipefail

extra_args=()

if tty -s; then
extra_args+=("-t")
fi

docker run \
--rm \
--user "$(id -u)" \
-i "${extra_args[@]}" \
-e TX_TOKEN \
-e HOME \
-v "$HOME:$HOME" \
-v "$(readlink -f .)":/ws \
--entrypoint sh \
-w /ws \
"$image" \
-c "${commands[@]}"

0 comments on commit ea3e01b

Please sign in to comment.