-
-
Couldn't load subscription status.
- Fork 320
Migrate Jenkins build job "cyberduck-release-windows" to GitHub Actions #15555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
490a3c2
ccabc97
7c6015a
8795297
5bdd666
70e22c7
b05f3ef
c7ad044
e9297de
f67f6ef
3404b02
547c0b8
9f7cd51
0689757
67679c0
60255dc
5cbf6d6
07fed6c
7a6faaa
9a129dd
e175cf7
52633d0
b415011
dc9cbb6
4750959
06ca975
40c20d8
6132d45
1e30dc4
66e1d6a
fb97d74
89ae06d
14c4335
19b212f
0402597
42aff91
a88efc1
0143980
d4cd2c1
a965c78
015c434
66010a2
ef7cfa9
cf60354
d2dec59
4133db3
c04c677
5117f28
281b117
9a33b95
97b2974
8c9d9d9
54e8022
4d8e6c9
dc9ac7c
bf31d55
0b49d4f
05f7642
9529548
fcf4033
e64eb1f
92ff5b4
f0a745c
f30c2ae
d1cd6e0
9ab78ab
fb755bd
3a53a0f
b9ec705
5b1089a
9109341
b67150b
9ad1c06
8eb3621
cd03e5e
1fe7fee
9d0b815
5928617
bf459a0
7a4e22b
f93dbf3
2218f53
f6091a1
ccdab04
daf2993
ec9f070
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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/[email protected] | ||
| - 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 | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,208 @@ | ||
| 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 }}" | ||
| AWS_CUSTOM_IP5_ACCESS_KEY_DEPLOYMENT: "${{ secrets.AWS_CUSTOM_IP5_ACCESS_KEY_DEPLOYMENT }}" | ||
| AWS_CUSTOM_IP5_SECRET_KEY_DEPLOYMENT: "${{ secrets.AWS_CUSTOM_IP5_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/[email protected] | ||
| with: | ||
| fetch-depth: '0' | ||
| ref: ${{ inputs.GIT_TAG }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't think this input is required when the user selects a tag for the run from Run workflow. |
||
|
|
||
| - name: Copy Sparkle Updater Private Key (DSA) | ||
| shell: pwsh | ||
| env: | ||
| SPARKLE_UPDATER_PK: ${{ secrets.WIN_SPARKLE_UPDATER_PRIVATE_KEY }} | ||
| run: ${env:SPARKLE_UPDATER_PK} > "${env:GITHUB_WORKSPACE}\www\update\private.pem" | ||
|
|
||
| - name: Generate maven settings.xml | ||
| uses: s4u/[email protected] | ||
| with: | ||
| path: "${{ github.workspace }}/settings.xml" | ||
| servers: | | ||
| [{ | ||
| "id": "custom-ip5-maven.cyberduck.io-release", | ||
| "username": "${{ secrets.AWS_CUSTOM_IP5_ACCESS_KEY_DEPLOYMENT }}", | ||
| "password": "${{ secrets.AWS_CUSTOM_IP5_SECRET_KEY_DEPLOYMENT }}" | ||
| }, | ||
| { | ||
| "id": "custom-ip5-maven.cyberduck.io-snapshot", | ||
| "username": "${{ secrets.AWS_CUSTOM_IP5_ACCESS_KEY_DEPLOYMENT }}", | ||
| "password": "${{ secrets.AWS_CUSTOM_IP5_SECRET_KEY_DEPLOYMENT }}" | ||
| }, | ||
| { | ||
| "id": "maven.iterate.ch-release", | ||
| "username": "${{ secrets.AWS_ACCESS_KEY_DEPLOYMENT }}", | ||
| "password": "${{ secrets.AWS_SECRET_KEY_DEPLOYMENT }}" | ||
| }, | ||
| { | ||
| "id": "maven.iterate.ch-snapshot", | ||
| "username": "${{ secrets.AWS_ACCESS_KEY_DEPLOYMENT }}", | ||
| "password": "${{ secrets.AWS_SECRET_KEY_DEPLOYMENT }}" | ||
| }, | ||
| { | ||
| "id": "maven.cyberduck.io-release", | ||
| "username": "${{ secrets.AWS_ACCESS_KEY_DEPLOYMENT }}", | ||
| "password": "${{ secrets.AWS_SECRET_KEY_DEPLOYMENT }}" | ||
| }, | ||
| { | ||
| "id": "maven.cyberduck.io-snapshot", | ||
| "username": "${{ secrets.AWS_ACCESS_KEY_DEPLOYMENT }}", | ||
| "password": "${{ secrets.AWS_SECRET_KEY_DEPLOYMENT }}" | ||
| }] | ||
|
|
||
| - name: Set up JDK 17 and skip overwriting of settings.xml | ||
| uses: actions/[email protected] | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '17' | ||
| settings-path: "${{ github.workspace }}" | ||
| overwrite-settings: false | ||
|
|
||
| - name: Install upload requirement Cyberduck CLI using chocolatey | ||
| shell: pwsh | ||
| run: Import-Module "${env:ChocolateyInstall}\helpers\chocolateyProfile.psm1" && choco install duck -y && refreshenv && "${env:Path}" | Out-File -FilePath ${env:GITHUB_PATH} -Append | ||
| # run: Import-Module "${env:ChocolateyInstall}\helpers\chocolateyProfile.psm1" && choco install duck -y && refreshenv && Get-Command duck | Split-Path -Parent | Out-File -FilePath ${env:GITHUB_PATH} -Append | ||
|
|
||
| - name: Install build requirement Bonjour Print Services for Windows (https://community.chocolatey.org/packages/bonjour) | ||
| shell: pwsh | ||
| run: Import-Module "${env:ChocolateyInstall}\helpers\chocolateyProfile.psm1" && choco install bonjour -y && refreshenv && "${env:Path}" | Out-File -FilePath ${env:GITHUB_PATH} -Append | ||
|
|
||
| - name: Install build requirement openssl using chocolatey | ||
| shell: pwsh | ||
| run: Import-Module "${env:ChocolateyInstall}\helpers\chocolateyProfile.psm1" && choco install openssl -y && refreshenv && "${env:Path}" | Out-File -FilePath ${env:GITHUB_PATH} -Append | ||
|
|
||
| - name: Add MSBuild.exe to PATH | ||
| uses: microsoft/[email protected] | ||
|
|
||
| - name: Run maven | ||
| # Todo: Remove "-e" and "-DskipSign=true" Options for production | ||
| run: mvn clean deploy -DskipSign=true -e --settings ${env:GITHUB_WORKSPACE}/settings.xml -DskipTests -D"sparkle.feed=" | ||
|
|
||
| - name: Upload files to Rackspace | ||
| shell: pwsh | ||
| run: echo "Dummy rackspace upload" | ||
| # run: Get-ChildItem "${Env:GITHUB_WORKSPACE}\windows\target\release\" -Filter Cyberduck-* | Foreach-Object -process { duck --upload rackspace:/cdn.cyberduck.ch/ $_.FullName --username ${Env:RACKSPACE_USER} --password ${Env:RACKSPACE_PASSWORD} --retry --quiet --existing overwrite --region DFW } | ||
| # 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: Upload files to AWS S3 Bucket | ||
| shell: pwsh | ||
| # Todo: Remove echos | ||
| run: dir "${Env:GITHUB_WORKSPACE}"; echo ${Env:GITHUB_WORKSPACE}\windows\target\release\; Get-ChildItem "${Env:GITHUB_WORKSPACE}\windows\target\release\" -Filter Cyberduck-* | Foreach-Object -process { duck --upload s3:/ip5-cicd-cyberduck/ $_.FullName --username ${Env:AWS_CUSTOM_IP5_ACCESS_KEY_DEPLOYMENT} --password ${Env:AWS_CUSTOM_IP5_SECRET_KEY_DEPLOYMENT} --retry --quiet --existing overwrite --region eu-west-1} | ||
| # run: Get-ChildItem "${Env:GITHUB_WORKSPACE}\windows\target\release\" -Filter Cyberduck-* | Foreach-Object -process { duck --upload s3:/release.cyberduck.io/ $_.FullName --username ${Env:AWS_ACCESS_KEY_DEPLOYMENT} --password ${Env:AWS_SECRET_KEY_DEPLOYMENT} --retry --quiet --existing overwrite --region us-east-1 } | ||
| # 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/[email protected] | ||
| 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 | ||
|
Comment on lines
+131
to
+158
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not required. |
||
|
|
||
| # # 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/[email protected] | ||
| 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/[email protected] | ||
| 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' | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleanup of workspace is not required in GitHub Actions context.