-
Notifications
You must be signed in to change notification settings - Fork 634
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
nerdctl version
and renew Makefile
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
- Loading branch information
1 parent
cd8fe44
commit be1c2bd
Showing
7 changed files
with
148 additions
and
70 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
- 'test-action-release-*' | ||
env: | ||
GO111MODULE: on | ||
jobs: | ||
release: | ||
strategy: | ||
matrix: | ||
go-version: [1.15.x] | ||
os: [ubuntu-20.04] | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: go/src/github.com/AkihiroSuda/nerdctl | ||
- name: "Compile binaries" | ||
working-directory: go/src/github.com/AkihiroSuda/nerdctl | ||
run: make artifacts | ||
- name: "SHA256SUMS" | ||
working-directory: go/src/github.com/AkihiroSuda/nerdctl | ||
run: | | ||
( cd _output; sha256sum nerdctl-* ) | tee /tmp/SHA256SUMS | ||
mv /tmp/SHA256SUMS _output/SHA256SUMS | ||
- name: "The sha256sum of the SHA256SUMS file" | ||
working-directory: go/src/github.com/AkihiroSuda/nerdctl | ||
run: (cd _output; sha256sum SHA256SUMS) | ||
- name: "Prepare the release note" | ||
working-directory: go/src/github.com/AkihiroSuda/nerdctl | ||
run: | | ||
tag="${GITHUB_REF##*/}" | ||
shasha=$(sha256sum _output/SHA256SUMS | awk '{print $1}') | ||
cat << EOF | tee /tmp/release-note.txt | ||
${tag} | ||
#### Changes | ||
(To be documented) | ||
#### About the binaries | ||
The binaries were built automatically on GitHub Actions. | ||
See the log to verify SHA256SUMS. | ||
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
The sha256sum of the SHA256SUMS file itself is ${shasha} . | ||
EOF | ||
- name: "Create release" | ||
working-directory: go/src/github.com/AkihiroSuda/nerdctl | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
tag="${GITHUB_REF##*/}" | ||
asset_flags=() | ||
for f in _output/*; do asset_flags+=("-a" "$f"); done | ||
hub release create "${asset_flags[@]}" -F /tmp/release-note.txt --draft "${tag}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Copyright (C) nerdctl authors. | ||
Copyright (C) containerd authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package version | ||
|
||
var ( | ||
// Version is filled via Makefile | ||
Version = "<unknown>" | ||
// Revison is filled via Makefile | ||
Revision = "<unknown>" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
Copyright (C) nerdctl authors. | ||
Copyright (C) containerd authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/AkihiroSuda/nerdctl/pkg/version" | ||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
var versionCommand = &cli.Command{ | ||
Name: "version", | ||
Usage: "Show the nerdctl version information", | ||
Action: versionAction, | ||
} | ||
|
||
func versionAction(clicontext *cli.Context) error { | ||
fmt.Fprintf(clicontext.App.Writer, "Client:\n") | ||
fmt.Fprintf(clicontext.App.Writer, " Version: %s\n", version.Version) | ||
fmt.Fprintf(clicontext.App.Writer, " Git commit: %s\n", version.Revision) | ||
return nil | ||
} |