diff --git a/.github/workflows/cyberduck-release-windows-chocolatey.yml b/.github/workflows/cyberduck-release-windows-chocolatey.yml new file mode 100644 index 00000000000..1500d5e8948 --- /dev/null +++ b/.github/workflows/cyberduck-release-windows-chocolatey.yml @@ -0,0 +1,19 @@ +name: cyberduck-release-windows-chocolatey +on: + workflow_dispatch: +env: + CHOCOLATEY_API: "${{ secrets.CHOCOLATEY_API_KEY }}" +# # TimestamperBuildWrapper was not converted because the behavior is available by default in GitHub Actions and/or it is not configurable +jobs: + build: + runs-on: + - windows-latest + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - name: run batch command + shell: cmd + run: FOR %%c in ("%GITHUB_REPOSITORY%\..\cyberduck-release-windows\windows\target\release\cyberduck.*.nupkg") DO C:\ProgramData\chocolatey\bin\cpush --verbose --api-key %CHOCOLATEY_API% %%c +# # Mailer plugin was not converted because GitHub Actions will email the actor after failed build and does not support emailing a list of recipients + + diff --git a/.github/workflows/cyberduck-release-windows.yml b/.github/workflows/cyberduck-release-windows.yml new file mode 100644 index 00000000000..59edc75a500 --- /dev/null +++ b/.github/workflows/cyberduck-release-windows.yml @@ -0,0 +1,160 @@ +name: cyberduck-release-windows +on: + workflow_dispatch: + inputs: + GIT_TAG: + required: false +env: + AWS_ACCESS_KEY_DEPLOYMENT: "${{ secrets.AWS_ACCESS_KEY_DEPLOYMENT }}" + AWS_SECRET_KEY_DEPLOYMENT: "${{ secrets.AWS_SECRET_KEY_DEPLOYMENT }}" + RACKSPACE_USER: "${{ secrets.RACKSPACE_USER }}" + RACKSPACE_PASSWORD: "${{ secrets.RACKSPACE_PASSWORD }}" + +jobs: + build: + runs-on: + - windows-latest + steps: + - name: clean workspace + shell: ruby {0} + run: |- + require "fileutils" + Dir.chdir(ENV["GITHUB_WORKSPACE"]) do + paths = Dir.glob(["**/*"]) + paths -= Dir.glob([".git/**", ".repository/**"]) + paths.each do |path| + File.delete(path) if File.file?(path) + FileUtils.rm_rf(path) if File.directory?(path) + end + end + - name: checkout + uses: actions/checkout@v4.1.0 + with: + ref: ${{ inputs.GIT_TAG }} + - name: Copy Sparkle Updater Private Key (DSA) + shell: powershell + env: + SPARKLE_UPDATER_PK: ${{ secrets.WIN_SPARKLE_UPDATER_PRIVATE_KEY }} + run: ${env:SPARKLE_UPDATER_PK} > "${env:GITHUB_WORKSPACE}\www\update\private.pem" + + - name: Set up JDK 17 + uses: actions/setup-java@v4.0.0 + with: + distribution: 'temurin' + java-version: '17' + settings-path: "${{ github.workspace }}" + - name: Generate maven settings.xml + uses: s4u/maven-settings-action@v2.8.0 + with: + servers: | + [{ + "id": "maven.iterate.ch-release", + "username": "AKIAI44PZB4OH5YGWFVA", + "password": "${{ secrets.MAVEN_SERVER_PASSWORD }}" + }, + { + "id": "maven.iterate.ch-snapshot", + "username": "AKIAI44PZB4OH5YGWFVA", + "password": "${{ secrets.MAVEN_SERVER_PASSWORD }}" + }, + { + "id": "maven.cyberduck.io-release", + "username": "AKIAI44PZB4OH5YGWFVA", + "password": "${{ secrets.MAVEN_SERVER_PASSWORD }}" + }, + { + "id": "maven.cyberduck.io-snapshot", + "username": "AKIAI44PZB4OH5YGWFVA", + "password": "${{ secrets.MAVEN_SERVER_PASSWORD }}" + }] + - name: Run maven + run: mvn clean deploy --settings ${env:GITHUB_WORKSPACE}/settings.xml -DskipTests -D"sparkle.feed=" + - name: run batch command + shell: cmd + run: FOR %%c in ("%GITHUB_WORKSPACE%\windows\target\release\Cyberduck-*") DO "C:\Program Files\Cyberduck CLI\duck.exe" --upload rackspace:/cdn.cyberduck.ch/ "%%c" --username %RACKSPACE_USER% --password %RACKSPACE_PASSWORD% --retry --quiet --existing overwrite --region DFW + - name: run batch command + shell: cmd + run: FOR %%c in ("%GITHUB_WORKSPACE%\windows\target\release\Cyberduck-*") DO "C:\Program Files\Cyberduck CLI\duck.exe" --upload s3:/release.cyberduck.io/ "%%c" --username %AWS_ACCESS_KEY_DEPLOYMENT% --password %AWS_SECRET_KEY_DEPLOYMENT% --retry --quiet --existing overwrite --region us-east-1 + - name: Upload Artifacts + uses: actions/upload-artifact@v3.1.3 + if: always() + with: + path: |- + windows\target\release\*.exe + windows\target\release\*.msi + windows\target\release\*.appx + !**/*~ + !**/#*# + !**/.#* + !**/%*% + !**/._* + !**/CVS + !**/CVS/** + !**/.cvsignore + !**/SCCS + !**/SCCS/** + !**/vssver.scc + !**/.svn + !**/.svn/** + !**/.DS_Store + !**/.git + !**/.git/** + !**/.gitattributes + !**/.gitignore + !**/.gitmodules + !**/.hg + !**/.hg/** + !**/.hgignore + !**/.hgsub + !**/.hgsubstate + !**/.hgtags + !**/.bzr + !**/.bzr/** + !**/.bzrignore +# # Fingerprinter was not converted because the behavior is available by default in GitHub Actions and/or it is not configurable +# # Mailer plugin was not converted because GitHub Actions will email the actor after failed build and does not support emailing a list of recipients + # Ensure parameter if_key_exists is set correctly + - name: Install SSH key + uses: shimataro/ssh-key-action@v2.6.1 + with: + key: "${{ secrets.VERSION_CYBERDUCK_IO_SSH_KEY }}" + name: id_rsa-version_cyberduck_io + known_hosts: "${{ secrets.VERSION_CYBERDUCK_IO_KNOWN_HOSTS }}" + if_key_exists: replace # replace will allow us to update the ssh-key on an existing build + config: | + Host VERSION_CYBERDUCK_IO + HostName ${{ secrets.VERSION_CYBERDUCK_IO_HOST_NAME }} + User ${{ secrets.VERSION_CYBERDUCK_IO_USER }} + IdentityFile ~/.ssh/id_rsa-version_cyberduck_io + if: always() + - name: setup file transfer file + uses: actions/github-script@v7.0.0 + with: + script: |- + const fs = require('fs').promises + const path = require('path') + const patterns = "windows/target/update/changelog.*,!**/*~,!**/#*#,!**/.#*,!**/%*%,!**/._*,!**/CVS,!**/CVS/**,!**/.cvsignore,!**/SCCS,!**/SCCS/**,!**/vssver.scc,!**/.svn,!**/.svn/**,!**/.DS_Store,!**/.git,!**/.git/**,!**/.gitattributes,!**/.gitignore,!**/.gitmodules,!**/.hg,!**/.hg/**,!**/.hgignore,!**/.hgsub,!**/.hgsubstate,!**/.hgtags,!**/.bzr,!**/.bzr/**,!**/.bzrignore" + const globber = await glob.create(patterns.replace(/,/g, "\n")) + const files = [] + for await (const file of globber.globGenerator()) { + if ((await fs.lstat(file)).isDirectory()) continue + files.push(path.relative(process.cwd(), file)) + } + fs.writeFile("version_cyberduck_io-transfer.txt", files.join("\n"), (err) => {}) + if: always() + - name: run file transfers + run: |- + ssh VERSION_CYBERDUCK_IO 'mkdir -p windows' + tar -cvf version_cyberduck_io-transfer.tar --files-from version_cyberduck_io-transfer.txt + scp version_cyberduck_io-transfer.tar VERSION_CYBERDUCK_IO: + ssh VERSION_CYBERDUCK_IO 'tar -xvf version_cyberduck_io-transfer.tar -C windows && rm version_cyberduck_io-transfer.tar' + if: always() +# # This item has no matching transformer +# - uses: hudson.tasks.BuildTrigger +# with: +# childProjects: cyberduck-release-windows-chocolatey +# threshold: +# name: SUCCESS +# ordinal: '0' +# color: BLUE +# completeBuild: 'true' diff --git a/.github/workflows/template-konzept.yml b/.github/workflows/template-konzept.yml new file mode 100644 index 00000000000..adb15fcf38e --- /dev/null +++ b/.github/workflows/template-konzept.yml @@ -0,0 +1,42 @@ +name: template-konzept + +on: + schedule: + - cron: '0 18 * * *' + release: + types: [published, prereleased] + +jobs: + set_variables_job: + runs-on: ubuntu-latest + outputs: + VariablePre: ${{steps.set_vars_schedule.outputs.VARIABLEPRE}} + VariableRel: ${{steps.set_vars_schedule.outputs.VARIABLEREL}} + VariableTim: ${{steps.set_vars_schedule.outputs.VARIABLETIM}} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set variables + id: set_vars_schedule + run: | + if [[ "${{ github.event_name }}" = "schedule" ]] + then + echo "VARIABLETIM=IT IS TIMEBASED! " >> "$GITHUB_OUTPUT" + fi + if [[ "${{ github.event_name }}" = "release" ]] + then + if "${{ github.event.release.prerelease }}" + then + echo "VARIABLEPRE=IT IS A PRERELEASE!" >> "$GITHUB_OUTPUT" + else + echo "VARIABLEREL=IT IS A RELEASE!" >> "$GITHUB_OUTPUT" + fi + fi + + call_resuable_job: + needs: set_variables_job + uses: ./.github/workflows/template-reusable.yml + with: + variablePre: ${{needs.set_variables_job.outputs.VariablePre}} + variableRel: ${{needs.set_variables_job.outputs.VariableRel}} + variableTim: ${{needs.set_variables_job.outputs.VariableTim}} diff --git a/.github/workflows/template-reusable.yml b/.github/workflows/template-reusable.yml new file mode 100644 index 00000000000..73b49f038f0 --- /dev/null +++ b/.github/workflows/template-reusable.yml @@ -0,0 +1,25 @@ +name: template-reusable + +on: + workflow_call: + inputs: + variablePre: + required: true + type: string + variableRel: + required: true + type: string + variableTim: + required: true + type: string + + +jobs: + my_job: + runs-on: ubuntu-latest + steps: + - name: Print variables + run: | + echo "Prerelease: ${{ inputs.variablePre }}" + echo "Release: ${{ inputs.variableRel }}" + echo "Time: ${{ inputs.variableTim }}" \ No newline at end of file diff --git a/pom.xml b/pom.xml index 9a134a02d0b..f85f0617a8d 100644 --- a/pom.xml +++ b/pom.xml @@ -859,12 +859,14 @@ maven.cyberduck.io-release - s3://repo.maven.cyberduck.io/releases/ + + file://${user.home} default maven.cyberduck.io-snapshot - s3://repo.maven.cyberduck.io/snapshots/ + file://${user.home} github-pages-site