ssh-keygen Generating public/private rsa key pair. Enter file inwhich to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: SHA256:XG1vkchp5b27tteZASx6ZrPRtTayGYmacRdjjRxR1Y0 [email protected] The key's randomart image is: +---[RSA 2048]----+ | .+o=| | o *Eoo| | . X B .| | . . + X +.| | S . = O..| | o O B =.| | O = *.*| | o . o ++| | .oo| +----[SHA256]-----+
on: push: # Sequence of patterns matched against refs/tags tags: -"v*"# Push events to matching v*, i.e. v1.0, v20.15.10 jobs: build: runs-on:ubuntu-latest
-name:UploadReleasenormalwindows uses:actions/[email protected] env: GITHUB_TOKEN:${{secrets.GITHUB_TOKEN}} with: upload_url:${{steps.create_release.outputs.upload_url}}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path:./normal-windows-x64.zip asset_name:normal-${{steps.create_release.outputs.tag}}-windows-x64.zip asset_content_type:application/zip -name:UploadReleasenormallinux uses:actions/[email protected] env: GITHUB_TOKEN:${{secrets.GITHUB_TOKEN}} with: upload_url:${{steps.create_release.outputs.upload_url}}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path:./normal-linux-x64.zip asset_name:normal-${{steps.create_release.outputs.tag}}-linux-x64.zip asset_content_type:application/zip -name:UploadReleasenormaldarwin uses:actions/[email protected] env: GITHUB_TOKEN:${{secrets.GITHUB_TOKEN}} with: upload_url:${{steps.create_release.outputs.upload_url}}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path:./normal-darwin-x64.zip asset_name:normal-${{steps.create_release.outputs.tag}}-darwin-x64.zip asset_content_type:application/zip
-name:UploadReleasecgowindows uses:actions/[email protected] env: GITHUB_TOKEN:${{secrets.GITHUB_TOKEN}} with: upload_url:${{steps.create_release.outputs.upload_url}}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path:./cgo-windows-x64.zip asset_name:cgo-${{steps.create_release.outputs.tag}}-windows-x64.zip asset_content_type:application/zip -name:UploadReleasecgolinux uses:actions/[email protected] env: GITHUB_TOKEN:${{secrets.GITHUB_TOKEN}} with: upload_url:${{steps.create_release.outputs.upload_url}}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path:./cgo-linux-x64.zip asset_name:cgo-${{steps.create_release.outputs.tag}}-linux-x64.zip asset_content_type:application/zip -name:UploadReleasecgodarwin uses:actions/[email protected] env: GITHUB_TOKEN:${{secrets.GITHUB_TOKEN}} with: upload_url:${{steps.create_release.outputs.upload_url}}# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path:./cgo-darwin-x64.zip asset_name:cgo-${{steps.create_release.outputs.tag}}-darwin-x64.zip asset_content_type:application/zip
在Github Actions提供的虚拟机中,已经内置了docker,而刚好我有一个项目因为国内的网络原因构建docker镜像非常的慢,这是我fork的一个用于 go 项目交叉编译的项目,仓库地址https://github.com/monkeyWie/xgo,这个项目的主要工作原理就是通过 docker 里内置好各种交叉编译的工具链,然后对外提供 go 项目交叉编译功能,下面节选一点Dockerfile内容: