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 21, 2023
1 parent 8fe52bd commit b7ca636
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 19 deletions.
27 changes: 18 additions & 9 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 @@ -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 }}
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.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $packageVersion = $env:ChocolateyPackageVersion
$packageArgs = @{
packageName = $packageName
unzipLocation = $toolsDir
url = 'https://downloads.crowdin.com/cli/v3/crowdin-cli.zip'
url = 'https://github.com/crowdin/crowdin-cli/releases/latest/download/crowdin-cli.zip'
checksum = '9078bcacbb481eb01fbbfaf6bef87322bb1ca8d6835b543517e913127e0089c4'
checksumType = 'sha256'
}
Expand Down
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.
12 changes: 6 additions & 6 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ module.exports = {
},
{
"files": [
"pkgbuild/PKGBUILD"
"packages/aur/pkgbuild/PKGBUILD"
],
"from": "pkgver=.*",
"to": "pkgver=${nextRelease.version}",
"results": [
{
"file": "pkgbuild/PKGBUILD",
"file": "packages/aur/pkgbuild/PKGBUILD",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
Expand All @@ -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 @@ -115,8 +115,8 @@ module.exports = {
"src/main/resources/crowdin.properties",
"package.json",
"package-lock.json",
"pkgbuild/PKGBUILD",
"chocolatey/*",
"packages/aur/pkgbuild/PKGBUILD",
"packages/chocolatey/*",
"CHANGELOG.md"
],
"message": "chore(release): version ${nextRelease.version} [skip ci]"
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/crowdin.properties
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:/crowdin/crowdin-cli/releases/latest/download/version.txt
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 b7ca636

Please sign in to comment.