Track latest version by Major.Minor when releasing via GoReleaser

We want to be able to download the latest published version for a
specific Major.Minor. In the Dagger GitHub Action, we want to be able to
restrict the versions to e.g. latest 0.2.

We took this opportunity to change the URL schema and scope all versions
to /versions, e.g. /versions/latest, /versions/0.1, /versions/0.2, etc.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
This commit is contained in:
Gerhard Lazu 2022-03-09 16:10:53 +00:00
parent 17c45ea36c
commit 91c45ade3d
No known key found for this signature in database
GPG Key ID: A28DE70C9444D7A6

View File

@ -67,7 +67,7 @@ blobs:
folder: "dagger/releases/{{ .Version }}"
publishers:
- name: publish-version
- name: publish-latest-version
cmd: sh -c "echo {{ .Version }} | aws s3 cp - s3://dagger-io/dagger/latest_version"
env:
- PATH={{ .Env.PATH }}
@ -75,3 +75,19 @@ publishers:
- AWS_ACCESS_KEY_ID={{ .Env.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY={{ .Env.AWS_SECRET_ACCESS_KEY }}
- AWS_REGION={{ .Env.AWS_REGION }}
- name: publish-latest
cmd: sh -c "echo {{ .Version }} | aws s3 cp - s3://dagger-io/dagger/versions/latest"
env:
- PATH={{ .Env.PATH }}
- AWS_EC2_METADATA_DISABLED=true
- AWS_ACCESS_KEY_ID={{ .Env.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY={{ .Env.AWS_SECRET_ACCESS_KEY }}
- AWS_REGION={{ .Env.AWS_REGION }}
- name: publish-latest-major-minor
cmd: sh -c "echo {{ .Version }} | aws s3 cp - s3://dagger-io/dagger/versions/{{ .Major }}.{{ .Minor }}"
env:
- PATH={{ .Env.PATH }}
- AWS_EC2_METADATA_DISABLED=true
- AWS_ACCESS_KEY_ID={{ .Env.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY={{ .Env.AWS_SECRET_ACCESS_KEY }}
- AWS_REGION={{ .Env.AWS_REGION }}