Skip to content

Commit

Permalink
ci: generate zip package and version file
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar committed Dec 20, 2023
1 parent 8fe52bd commit 75751f7
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 12 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -136,13 +145,13 @@ 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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
49 changes: 49 additions & 0 deletions packages/zip/README.txt
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.
6 changes: 3 additions & 3 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ module.exports = {
},
{
"files": [
"chocolatey/crowdin-cli.nuspec"
"packages/chocolatey/crowdin-cli.nuspec"
],
"from": "<version>.*</version>",
"to": "<version>${nextRelease.version}</version>",
"results": [
{
"file": "chocolatey/crowdin-cli.nuspec",
"file": "packages/chocolatey/crowdin-cli.nuspec",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
Expand All @@ -116,7 +116,7 @@ module.exports = {
"package.json",
"package-lock.json",
"pkgbuild/PKGBUILD",
"chocolatey/*",
"packages/chocolatey/*",
"CHANGELOG.md"
],
"message": "chore(release): version ${nextRelease.version} [skip ci]"
Expand Down
2 changes: 1 addition & 1 deletion website/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ docker pull crowdin/cli

## Standalone version

Crowdin CLI can be installed as a stand-alone Java application. [Download for macOS, Linux and Windows](https://downloads.crowdin.com/cli/v3/crowdin-cli.zip)
Crowdin CLI can be installed as a stand-alone Java application. [Download](https://github.com/crowdin/crowdin-cli/releases/latest/download/crowdin-cli.zip).

### Installation on Linux and macOS

Expand Down

0 comments on commit 75751f7

Please sign in to comment.