|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - 'v*' |
| 6 | + - 'test-action-release-*' |
| 7 | +env: |
| 8 | + GO111MODULE: on |
| 9 | +jobs: |
| 10 | + release: |
| 11 | + runs-on: ubuntu-20.04 |
| 12 | + timeout-minutes: 20 |
| 13 | + steps: |
| 14 | + - uses: actions/setup-go@v2 |
| 15 | + with: |
| 16 | + go-version: 1.16.x |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + with: |
| 19 | + path: go/src/github.com/AkihiroSuda/containerd-fuse-overlayfs |
| 20 | + - name: "Compile binaries" |
| 21 | + working-directory: go/src/github.com/AkihiroSuda/containerd-fuse-overlayfs |
| 22 | + run: make artifacts |
| 23 | + - name: "SHA256SUMS" |
| 24 | + working-directory: go/src/github.com/AkihiroSuda/containerd-fuse-overlayfs |
| 25 | + run: | |
| 26 | + ( cd _output; sha256sum containerd-fuse-overlayfs-* ) | tee /tmp/SHA256SUMS |
| 27 | + mv /tmp/SHA256SUMS _output/SHA256SUMS |
| 28 | + - name: "The sha256sum of the SHA256SUMS file" |
| 29 | + working-directory: go/src/github.com/AkihiroSuda/containerd-fuse-overlayfs |
| 30 | + run: (cd _output; sha256sum SHA256SUMS) |
| 31 | + - name: "Prepare the release note" |
| 32 | + working-directory: go/src/github.com/AkihiroSuda/containerd-fuse-overlayfs |
| 33 | + run: | |
| 34 | + tag="${GITHUB_REF##*/}" |
| 35 | + shasha=$(sha256sum _output/SHA256SUMS | awk '{print $1}') |
| 36 | + cat <<-EOF | tee /tmp/release-note.txt |
| 37 | + ${tag} |
| 38 | +
|
| 39 | + (To be documented) |
| 40 | + - - - |
| 41 | + The binaries were built automatically on GitHub Actions. |
| 42 | + The build log is available for 90 days: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 43 | +
|
| 44 | + The sha256sum of the SHA256SUMS file itself is \`${shasha}\` . |
| 45 | + EOF |
| 46 | + - name: "Create release" |
| 47 | + working-directory: go/src/github.com/AkihiroSuda/containerd-fuse-overlayfs |
| 48 | + env: |
| 49 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + run: | |
| 51 | + tag="${GITHUB_REF##*/}" |
| 52 | + asset_flags=() |
| 53 | + for f in _output/*; do asset_flags+=("-a" "$f"); done |
| 54 | + hub release create "${asset_flags[@]}" -F /tmp/release-note.txt --draft "${tag}" |
0 commit comments