Skip to content

Commit 1fd6a2f

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/checkout-6
2 parents cae0985 + b2104be commit 1fd6a2f

File tree

5 files changed

+209
-31
lines changed

5 files changed

+209
-31
lines changed

.github/workflows/build.yml

Lines changed: 48 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,51 @@ on:
66
branches: [ main ]
77

88
jobs:
9-
build-all-clis:
10-
name: Build Only (No Release)
11-
runs-on: [ubuntu-latest]
12-
steps:
13-
- uses: actions/checkout@v6
14-
15-
- name: Set up Go
16-
uses: actions/setup-go@v6
17-
with:
18-
go-version-file: 'go.mod'
19-
20-
- name: Storage-CLI Build for Linux
21-
env:
22-
GOOS: linux
23-
GOARCH: amd64
24-
CGO_ENABLED: 0
25-
run: |
26-
echo "Building Storage CLI for Linux"
27-
go build -o "storage-cli-linux-amd64"
28-
sha1sum "storage-cli-linux-amd64"
29-
30-
- name: Storage-CLI Build for Windows
31-
env:
32-
GOOS: windows
33-
GOARCH: amd64
34-
CGO_ENABLED: 0
35-
run: |
36-
echo "Building Storage CLI for Windows"
37-
go build -o "storage-cli-windows-amd64.exe"
38-
sha1sum "storage-cli-windows-amd64.exe"
9+
build-all-clis:
10+
name: Build Only (No Release)
11+
runs-on: [ubuntu-latest]
12+
steps:
13+
- uses: actions/checkout@v6
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v6
17+
with:
18+
go-version-file: 'go.mod'
19+
20+
- name: Storage-CLI Build for Linux
21+
env:
22+
GOOS: linux
23+
GOARCH: amd64
24+
CGO_ENABLED: 0
25+
run: |
26+
echo "Building Storage CLI for Linux"
27+
go build -ldflags "-X main.version=0.0.0" \
28+
-o "storage-cli-linux-amd64"
29+
sha1sum "storage-cli-linux-amd64"
30+
31+
- name: Storage-CLI Build for Windows
32+
env:
33+
GOOS: windows
34+
GOARCH: amd64
35+
CGO_ENABLED: 0
36+
run: |
37+
echo "Building Storage CLI for Windows"
38+
go build -ldflags "-X main.version=0.0.0" \
39+
-o "storage-cli-windows-amd64.exe"
40+
sha1sum "storage-cli-windows-amd64.exe"
41+
42+
- name: Sanitize branch name
43+
id: sanitize
44+
run: |
45+
BRANCH_NAME="${{ github.ref_name }}"
46+
SAFE_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g')
47+
echo "branch=$SAFE_BRANCH" >> $GITHUB_OUTPUT
48+
49+
- name: Upload Build Artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: storage-cli-${{ steps.sanitize.outputs.branch }}-${{ github.sha }}
53+
path: |
54+
storage-cli-linux-amd64
55+
storage-cli-windows-amd64.exe
56+
retention-days: 30
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Release Manual
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version (e.g., v1.2.3)'
8+
required: true
9+
type: string
10+
release:
11+
types: [published]
12+
13+
jobs:
14+
tests:
15+
name: Run Unit Tests
16+
runs-on: [ubuntu-latest]
17+
steps:
18+
- name: Checkout Into Source Code
19+
uses: actions/checkout@v5
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v6
23+
with:
24+
go-version-file: go.mod
25+
26+
- name: Lint code
27+
uses: golangci/golangci-lint-action@v8
28+
29+
- name: Run Unit Tests
30+
run: |
31+
export CGO_ENABLED=0
32+
go version
33+
go run github.com/onsi/ginkgo/v2/ginkgo --skip-package=integration ./...
34+
35+
build-and-release:
36+
name: Build and Release
37+
needs: tests
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout Into Source Code
41+
uses: actions/checkout@v5
42+
43+
- name: Set up Go
44+
uses: actions/setup-go@v6
45+
with:
46+
go-version-file: go.mod
47+
48+
- name: Determine Version
49+
id: version
50+
run: |
51+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
52+
INPUT_VERSION="${{ github.event.inputs.version }}"
53+
else
54+
INPUT_VERSION="${{ github.event.release.tag_name }}"
55+
fi
56+
57+
# Validate version starts with 'v'
58+
if [[ ! "$INPUT_VERSION" == v* ]]; then
59+
echo "Error: Version must start with 'v' (e.g., v1.2.3)"
60+
echo "Provided: $INPUT_VERSION"
61+
exit 1
62+
fi
63+
64+
VERSION="$INPUT_VERSION"
65+
VERSION_NUMBER=${VERSION#v}
66+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
67+
echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_OUTPUT
68+
echo "Building version: $VERSION (number: $VERSION_NUMBER)"
69+
70+
- name: Create Tag (if workflow_dispatch)
71+
if: github.event_name == 'workflow_dispatch'
72+
run: |
73+
git config user.name "github-actions[bot]"
74+
git config user.email "github-actions[bot]@users.noreply.github.com"
75+
git tag -a "${{ steps.version.outputs.VERSION }}" -m "Release ${{ steps.version.outputs.VERSION }}"
76+
git push origin "${{ steps.version.outputs.VERSION }}"
77+
78+
- name: Build for Linux
79+
env:
80+
GOOS: linux
81+
GOARCH: amd64
82+
CGO_ENABLED: 0
83+
run: |
84+
echo "Building Storage CLI for Linux"
85+
go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION_NUMBER }}" \
86+
-o "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-amd64"
87+
echo "### Linux Build Checksums" >> $GITHUB_STEP_SUMMARY
88+
echo '```' >> $GITHUB_STEP_SUMMARY
89+
sha1sum "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-amd64" >> $GITHUB_STEP_SUMMARY
90+
echo '```' >> $GITHUB_STEP_SUMMARY
91+
92+
- name: Build for Windows
93+
env:
94+
GOOS: windows
95+
GOARCH: amd64
96+
CGO_ENABLED: 0
97+
run: |
98+
echo "Building Storage CLI for Windows"
99+
go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION_NUMBER }}" \
100+
-o "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-windows-amd64.exe"
101+
echo "### Windows Build Checksums" >> $GITHUB_STEP_SUMMARY
102+
echo '```' >> $GITHUB_STEP_SUMMARY
103+
sha1sum "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-windows-amd64.exe" >> $GITHUB_STEP_SUMMARY
104+
echo '```' >> $GITHUB_STEP_SUMMARY
105+
106+
- name: Create or Update Github Release
107+
uses: ncipollo/release-action@v1
108+
with:
109+
tag: ${{ steps.version.outputs.VERSION }}
110+
name: Release ${{ steps.version.outputs.VERSION }}
111+
body: Release ${{ steps.version.outputs.VERSION }}
112+
artifacts: |
113+
storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-amd64
114+
storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-windows-amd64.exe
115+
token: ${{ secrets.GITHUB_TOKEN }}
116+
allowUpdates: true
117+
makeLatest: true
118+
omitNameDuringUpdate: ${{ github.event_name == 'release' }}
119+
omitBodyDuringUpdate: ${{ github.event_name == 'release' }}

.github/workflows/unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
go-version-file: go.mod
1919
- name: Lint code
20-
uses: golangci/golangci-lint-action@v8
20+
uses: golangci/golangci-lint-action@v9
2121
- name: Cache Go modules
2222
uses: actions/cache@v4
2323
with:

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,33 @@ Follow these steps to make a contribution to the project:
104104
```
105105
- Create a GitHub pull request, selecting `main` as the target branch
106106

107+
## Releases
108+
109+
### Manual Release
110+
Releases must be triggered manually by an approver. This can be done either via `GitHub Actions` (workflow dispatch) or through the `GitHub Releases` page using the **Draft a new release** option. The *Release Manual* workflow is responsible for creating and completing the release.
111+
112+
Option 1: Release via Workflow Dispatch
113+
114+
- Go to Actions and select the *Release Manual* workflow.
115+
116+
- Click **Run workflow**.
117+
118+
- Enter the next incremented version number with the v prefix (for example, v1.2.3).
119+
120+
- The workflow will create the release and upload the build artifacts once completed.
121+
122+
Option 2: Release via Draft Release
123+
124+
- Go to Releases and click **Draft a new release**.
125+
126+
- Create a new tag using the next incremented version with the v prefix.
127+
128+
- Fill in the release title and description.
129+
130+
- Click Publish release.
131+
132+
- The release will appear immediately on the Releases page. This action will also trigger the *Release Manual* workflow, which will build the artifacts and upload them to the published release once the workflow finishes.
133+
107134

108135
## Notes
109136
These commit IDs represent the last migration checkpoint from each provider's original repository, marking the final commit that was copied during the consolidation process.

gcs/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ This is **not** an official Google Product.
1111
## GCS-Specific Configuration
1212

1313
The GCS client requires a JSON configuration file.
14+
``` json
15+
{
16+
"bucket_name": "<string> (required)",
17+
"credentials_source": "<string> ['static'|'none'|""]",
18+
"json_key": "<string> (required if credentials_source = 'static')",
19+
"storage_class": "<string> (optional - default: 'STANDARD', check for more options=https://docs.cloud.google.com/storage/docs/storage-classes)",
20+
"encryption_key": "<string> (optional)",
21+
}
22+
```
23+
24+
### Credentials Source Types
25+
* **"":** specifies that credentials should be detected. Application Default Credentials will be used if avaliable. A read-only client will be used otherwise.
26+
* **"none":** specifies that credentials are explicitly empty and that the client should be restricted to a read-only scope.
27+
* **"static:"** specifies that a service account file included in json_key should be used for authentication.
1428

1529
### Authentication Methods (`credentials_source`)
1630
* `static`: A [service account](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) key will be provided via the `json_key` field.

0 commit comments

Comments
 (0)