Skip to content

Commit

Permalink
Fix release job working directory
Browse files Browse the repository at this point in the history
Simplify the working directory management of the release job.

Signed-off-by: Sascha Grunert <[email protected]>
  • Loading branch information
saschagrunert committed Aug 8, 2024
1 parent 5c35c71 commit 8297e78
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 27 deletions.
35 changes: 10 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,33 @@ on:
push:
tags:
- "*"
branches:
- release-job
jobs:
publish:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false

- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: go-release-${{ hashFiles('**/go.sum') }}
restore-keys: go-release-
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: src/github.com/kubernetes-sigs/cri-tools
- run: |
make release-notes release
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- run: make release-notes release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
working-directory: src/github.com/kubernetes-sigs/cri-tools
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: src/github.com/kubernetes-sigs/cri-tools/_output/releases/*
bodyFile: src/github.com/kubernetes-sigs/cri-tools/release-notes.md
artifacts: _output/releases/*
bodyFile: release-notes.md
token: ${{ secrets.GH_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: release-notes
path: src/github.com/kubernetes-sigs/cri-tools/release-notes.md
path: release-notes.md
- uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: src/github.com/kubernetes-sigs/cri-tools/_output
path: _output
2 changes: 1 addition & 1 deletion hack/release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -euo pipefail

BUILD_DIR=build
BINARY=$BUILD_DIR/release-notes
VERSION=v0.16.8
VERSION=v0.17.2

mkdir -p $BUILD_DIR
curl -sSfL --retry 5 --retry-delay 10 -o $BINARY \
Expand Down
2 changes: 1 addition & 1 deletion hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CRI_TEST_PLATFORMS=(

# Create releases output directory.
PROJECT="sigs.k8s.io/cri-tools"
CRI_TOOLS_ROOT="$GOPATH/src/$PROJECT"
CRI_TOOLS_ROOT="$(go env GOPATH)/src/$PROJECT"
OUTPUTDIR=$CRI_TOOLS_ROOT/_output/releases
mkdir -p "$OUTPUTDIR"

Expand Down

0 comments on commit 8297e78

Please sign in to comment.