chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.58.2 to 1.63.0 #44
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
name: Test and Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- ".github/workflows/*.yml" | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- ".github/workflows/*.yml" | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
permissions: write-all | |
strategy: | |
matrix: | |
build-tag: [ 'none' ] | |
goos: [ linux ] | |
goarch: [ amd64 ] | |
goamd64: [ v1, v3 ] | |
include: | |
- build-tag: none | |
goos: linux | |
goarch: arm64 | |
- build-tag: none | |
goos: linux | |
goarch: riscv64 | |
fail-fast: false | |
runs-on: ubuntu-latest | |
env: | |
BUILD_TAG: ${{ matrix.build-tag }} | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
GOAMD64: ${{ matrix.goamd64 }} | |
CGO_ENABLED: 0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Generate build information | |
id: get_filename | |
run: | | |
echo "BUILD_TAG: $BUILD_TAG, GOOS: $GOOS, GOARCH: $GOARCH, GOAMD64: $GOAMD64" | |
if [ "$GOAMD64" == "v3" ]; then | |
if [ "$BUILD_TAG" == "none" ]; then | |
echo "ASSET_NAME=$GOOS-$GOARCH$GOAMD64" >> $GITHUB_OUTPUT | |
echo "ASSET_NAME=$GOOS-$GOARCH$GOAMD64" >> $GITHUB_ENV | |
else | |
echo "ASSET_NAME=$GOOS-$GOARCH$GOAMD64-$BUILD_TAG" >> $GITHUB_OUTPUT | |
echo "ASSET_NAME=$GOOS-$GOARCH$GOAMD64-$BUILD_TAG" >> $GITHUB_ENV | |
fi | |
else | |
if [ "$BUILD_TAG" == "none" ]; then | |
echo "ASSET_NAME=$GOOS-$GOARCH" >> $GITHUB_OUTPUT | |
echo "ASSET_NAME=$GOOS-$GOARCH" >> $GITHUB_ENV | |
else | |
echo "ASSET_NAME=$GOOS-$GOARCH-$BUILD_TAG" >> $GITHUB_OUTPUT | |
echo "ASSET_NAME=$GOOS-$GOARCH-$BUILD_TAG" >> $GITHUB_ENV | |
fi | |
fi | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.22 | |
- name: Get project dependencies | |
run: go mod download | |
- name: Build ObjectShare Binary | |
run: | | |
mkdir -p build_assets | |
if [ $BUILD_TAG != "none" ]; then | |
go build -v -o build_assets/object-share -trimpath -ldflags "-s -w -buildid=" -tags $BUILD_TAG | |
else | |
go build -v -o build_assets/object-share -trimpath -ldflags "-s -w -buildid=" | |
fi | |
- name: Prepare config files | |
run: | | |
cp ${GITHUB_WORKSPACE}/README.md ./build_assets/README.md | |
cp ${GITHUB_WORKSPACE}/LICENSE ./build_assets/LICENSE | |
cp ${GITHUB_WORKSPACE}/config.json.example ./build_assets/config.json.example | |
- name: Create zip archive | |
run: | | |
pushd build_assets || exit 1 | |
touch -mt $(date +%Y01010000) * | |
zip -9vr ../object-share-$ASSET_NAME.zip . | |
popd || exit 1 | |
FILE=./object-share-$ASSET_NAME.zip | |
DGST=$FILE.hash.txt | |
openssl dgst -sha256 $FILE | sed 's/([^)]*)//g' >>$DGST | |
openssl dgst -sha3-256 $FILE | sed 's/([^)]*)//g' >>$DGST | |
mv build_assets object-share-$ASSET_NAME | |
- name: Upload files to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: object-share-${{ steps.get_filename.outputs.ASSET_NAME }} | |
path: | | |
./object-share-${{ steps.get_filename.outputs.ASSET_NAME }}/* | |
- name: Upload files to release | |
uses: svenstaro/upload-release-action@v2 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./object-share-${{ steps.get_filename.outputs.ASSET_NAME }}.zip* | |
tag: ${{ github.ref }} | |
file_glob: true |