使用 GitHub Actions 进行 Go beta 版本的发布

huangapple go评论96阅读模式
英文:

Using Go beta releases with GitHub Actions

问题

可以使用 GitHub Actions 来使用 Go 语言的预览版本吗?

目前有一个 1.18 beta 版本,我想在我的项目中开始使用一些新的变化。

英文:

Is it possible to use preview releases of the Go language with GitHub Actions?

Currently there is a 1.18 beta out and I'd like to start using some of the new changes in my projects already.

答案1

得分: 3

似乎还不能通过该操作来获取,但你可以手动安装。

以下是一个示例:

name: Golang

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: 设置 Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.17.5
      - name: 安装 beta 版本
        run: |
          go install golang.org/dl/go1.18beta1@latest
          go1.18beta1 download
          cp $(which go1.18beta1) $(which go)
          go version
英文:

It seems it's not yet available through that action, but you can always install it manually.

Here's an example:

name: Golang

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup go
        uses: actions/setup-go@v2
        with:
          go-version: 1.17.5
      - name: Install beta version
        run: |
          go install golang.org/dl/go1.18beta1@latest
          go1.18beta1 download
          cp $(which go1.18beta1) $(which go)
          go version

huangapple
  • 本文由 发表于 2021年12月17日 15:15:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/70389582.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定