-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: generate zip package and version file, add docker deployment (#687)
- Loading branch information
1 parent
8fe52bd
commit 80f0604
Showing
14 changed files
with
110 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,31 +22,40 @@ jobs: | |
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Download the latest zip | ||
uses: carlosperate/download-file-action@v2 | ||
with: | ||
file-url: 'https://downloads.crowdin.com/cli/v3/crowdin-cli.zip' | ||
|
||
- name: Generate autocomplete script | ||
run: | | ||
./gradlew shadowJar | ||
cd build/libs | ||
java -cp crowdin-cli-*.jar picocli.AutoComplete com.crowdin.cli.commands.picocli.RootCommand | ||
- name: Build zip package | ||
run: | | ||
mkdir crowdin-cli | ||
cp build/libs/crowdin-cli-*.jar crowdin-cli/crowdin-cli.jar | ||
cp build/libs/crowdin_completion crowdin-cli/crowdin_completion | ||
cp packages/zip/* crowdin-cli/ | ||
zip -r crowdin-cli.zip crowdin-cli && chmod 0644 crowdin-cli.zip | ||
rm -rf crowdin-cli | ||
- name: Generate shasum | ||
id: shasum | ||
run: | | ||
echo hash=$(shasum -a 256 crowdin-cli.zip | cut -f 1 -d " ") >> $GITHUB_OUTPUT | ||
touch crowdin-cli_checksum.sha256 | ||
shasum -a 256 crowdin-cli.zip > crowdin-cli_checksum.sha256 | ||
- name: Generate version.txt file | ||
run: | | ||
echo ${{ github.ref_name }} > version.txt | ||
- name: Upload asset | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
crowdin-cli.zip | ||
crowdin-cli_checksum.sha256 | ||
build/libs/crowdin_completion | ||
version.txt | ||
npm: | ||
runs-on: ubuntu-latest | ||
|
@@ -106,7 +115,7 @@ jobs: | |
uses: KSXGitHub/[email protected] | ||
with: | ||
pkgname: crowdin-cli | ||
pkgbuild: ./pkgbuild/PKGBUILD | ||
pkgbuild: ./packages/aur/pkgbuild/PKGBUILD | ||
commit_username: ${{ secrets.AUR_USERNAME }} | ||
commit_email: ${{ secrets.AUR_EMAIL }} | ||
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | ||
|
@@ -136,15 +145,32 @@ jobs: | |
- name: Update checksum | ||
run: | | ||
echo "New Hash: ${{ needs.assets.outputs.checksum }}\n" | ||
sed -i "s/checksum = '.*'/checksum = '${{ needs.assets.outputs.checksum }}'/g" chocolatey/tools/chocolateyinstall.ps1 | ||
cat chocolatey/tools/chocolateyinstall.ps1 | ||
sed -i "s/checksum = '.*'/checksum = '${{ needs.assets.outputs.checksum }}'/g" packages/chocolatey/tools/chocolateyinstall.ps1 | ||
cat packages/chocolatey/tools/chocolateyinstall.ps1 | ||
- name: Choco pack | ||
uses: crazy-max/ghaction-chocolatey@v2 | ||
with: | ||
args: pack chocolatey/crowdin-cli.nuspec | ||
args: pack packages/chocolatey/crowdin-cli.nuspec | ||
|
||
- name: Choco publish | ||
uses: crazy-max/ghaction-chocolatey@v2 | ||
with: | ||
args: push --api-key ${{ secrets.CHOCOLATEY_API_KEY }} --source=https://push.chocolatey.org/ | ||
|
||
docker: | ||
runs-on: ubuntu-latest | ||
needs: assets | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Copy Dockerfile | ||
run: | | ||
cp packages/docker/Dockerfile Dockerfile | ||
- name: Build Docker image | ||
run: | | ||
docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}" docker.io | ||
docker build --pull -t "${{ secrets.DOCKER_HUB_REGISTRY_IMAGE }}:${{ github.ref_name }}" -t "${{ secrets.DOCKER_HUB_REGISTRY_IMAGE }}:latest" . | ||
docker push "${{ secrets.DOCKER_HUB_REGISTRY_IMAGE }}:${{ github.ref_name }}" | ||
docker push "${{ secrets.DOCKER_HUB_REGISTRY_IMAGE }}:latest" |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM alpine | ||
|
||
RUN apk --no-cache add sudo openjdk11-jre --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community; | ||
|
||
ADD https://github.com/crowdin/crowdin-cli/releases/latest/download/crowdin-cli.zip /usr/ | ||
|
||
RUN unzip -j /usr/crowdin-cli.zip; \ | ||
sh install-crowdin-cli.sh; \ | ||
rm /usr/crowdin-cli.zip; \ | ||
rm *.*; | ||
|
||
RUN echo -e '#!/bin/sh\njava -jar /usr/local/bin/crowdin-cli.jar "$@"' > /usr/local/bin/crowdin; \ | ||
chmod +x /usr/local/bin/crowdin; | ||
|
||
WORKDIR /usr/crowdin-project | ||
|
||
CMD ["sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
------------------------------ Crowdin CLI v3 --------------------------------- | ||
|
||
# Installation on Linux and MacOS | ||
|
||
Run `. install-crowdin-cli.sh` in the terminal with sudo rights in order to add `crowdin` command to your terminal | ||
|
||
------------------------------------------------------------------------------- | ||
|
||
# Installation on Windows | ||
|
||
1. Open Command Prompt as an Administrator | ||
- Click Start | ||
- In the Start Search box, type `cmd`, and then press CTRL+SHIFT+ENTER | ||
- If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue | ||
|
||
2. Run `setup-crowdin.bat` script in order to add `crowdin` command to the Command Prompt | ||
3. Restart your Command Prompt | ||
|
||
------------------------------------------------------------------------------- | ||
|
||
# Running the App | ||
|
||
Use the following method to run the app: | ||
|
||
- crowdin | ||
|
||
Alternative method: | ||
|
||
- java -jar crowdin-cli.jar | ||
|
||
------------------------------------------------------------------------------- | ||
|
||
# General Commands | ||
|
||
To display help information: | ||
|
||
- crowdin -h | ||
|
||
To generate Crowdin CLI configuration skeleton: | ||
|
||
- crowdin init | ||
|
||
To analyze your configuration file for potential errors: | ||
|
||
- crowdin lint | ||
|
||
To show a list of source files in the current project: | ||
|
||
- crowdin list project |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
application.name=crowdin-cli | ||
application.version=3.15.0 | ||
application.base_url=https://api.crowdin.com | ||
application.user_agent=crowdin-java-cli | ||
application.version_file_url=https://downloads.crowdin.com/cli/v3/version.txt | ||
application.version_file_url=https://github.com/crowdin/crowdin-cli/releases/latest/download/version.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters