mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
77 lines
2.7 KiB
YAML
77 lines
2.7 KiB
YAML
name: Nightly builds
|
|
|
|
on:
|
|
# workflow_dispatch so that it can be triggered manually if needed
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
- cron: "34 21 * * *"
|
|
|
|
concurrency: ${{ github.workflow }}
|
|
|
|
jobs:
|
|
|
|
nightly_build:
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY_NIGHTLY_BUILDS }}
|
|
IBM_CLOUD_RESOURCE_GROUP: ${{ secrets.IBM_CLOUD_RESOURCE_GROUP }}
|
|
IBM_CLOUD_REGION: eu-de
|
|
IBM_CLOUD_OBJET_STORAGE_SERVICE_INSTANCE: ${{ secrets.IBM_CLOUD_OBJET_STORAGE_SERVICE_INSTANCE }}
|
|
IBM_CLOUD_OBJECT_STORAGE_BUCKET: ${{ secrets.IBM_CLOUD_OBJECT_STORAGE_BUCKET }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
|
|
- name: Install IBM Cloud CLI
|
|
run: |
|
|
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
|
|
ibmcloud --version
|
|
ibmcloud config --check-version=false
|
|
ibmcloud plugin install -f cloud-object-storage
|
|
|
|
- name: Authenticate with IBM Cloud CLI
|
|
run: |
|
|
ibmcloud login --apikey "${IBM_CLOUD_API_KEY}" -r "${IBM_CLOUD_REGION}" -g "${IBM_CLOUD_RESOURCE_GROUP}" --quiet
|
|
|
|
- name: Set CRN
|
|
run: |
|
|
CRN=$(ibmcloud resource service-instance "${IBM_CLOUD_OBJET_STORAGE_SERVICE_INSTANCE}" --output json | jq -r '.[0].guid | values')
|
|
if [[ -z "$CRN" ]]; then
|
|
echo "Unable to determine CRN for service instance ${IBM_CLOUD_OBJET_STORAGE_SERVICE_INSTANCE}"
|
|
exit 1
|
|
fi
|
|
ibmcloud cos config crn --crn "${CRN}"
|
|
|
|
- name: Check if bucket exists
|
|
run: |
|
|
if ! ibmcloud cos buckets | grep "${IBM_CLOUD_OBJECT_STORAGE_BUCKET}"; then
|
|
echo "Bucket not found: ${IBM_CLOUD_OBJECT_STORAGE_BUCKET}"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Cross-compile odo
|
|
run: |
|
|
export GITCOMMIT="$(git describe --no-match --always --abbrev=9 --dirty --broken)-nightly"
|
|
make cross
|
|
|
|
- name: Upload binaries
|
|
run: |
|
|
baseUrl="https://s3.${IBM_CLOUD_REGION}.cloud-object-storage.appdomain.cloud/${IBM_CLOUD_OBJECT_STORAGE_BUCKET}"
|
|
for f in `find ./dist/bin -type f -name 'odo*'`; do
|
|
bin=$(realpath "$f")
|
|
targetName=$(basename "$f" .exe)-$(basename $(dirname "$f"))
|
|
if [[ "${targetName}" == "odo-windows-"* ]]; then
|
|
targetName="${targetName}.exe"
|
|
fi
|
|
ibmcloud cos upload --bucket "${IBM_CLOUD_OBJECT_STORAGE_BUCKET}" --key "${targetName}" --file "${bin}"
|
|
echo "Binary $bin uploaded successfully and available at: ${baseUrl}/${targetName}"
|
|
done
|