124 lines
5.9 KiB
YAML
124 lines
5.9 KiB
YAML
name: build-daqingest-rhel7
|
|
on:
|
|
push:
|
|
tags:
|
|
- buildaction
|
|
workflow_dispatch:
|
|
inputs:
|
|
flags:
|
|
description: Additional flags
|
|
default: ""
|
|
required: false
|
|
deprecationMessage: Not supported
|
|
# debug:
|
|
# description: Debug symbols
|
|
# type: choice
|
|
# options:
|
|
# - Simple
|
|
# - Detailed
|
|
# default: Detailed
|
|
# release:
|
|
# description: Package
|
|
# type: boolean
|
|
# default: true
|
|
# other:
|
|
# description: Other
|
|
# type: environment
|
|
# required: false
|
|
jobs:
|
|
build-daqbuffer-job:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ugnvc/psi:daqbuild.0.0.1
|
|
# credentials:
|
|
# username: ${{ github.actor }}
|
|
# password: ${{ secrets.github_token }}
|
|
env:
|
|
PATH: /root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
RUSTUP_HOME: /root/.rustup
|
|
CARGO_HOME: /root/.cargo
|
|
# ports:
|
|
# - 3456
|
|
steps:
|
|
# - run: find /github -type f
|
|
# - run: cat /github/workflow/event.json
|
|
# - run: ls -la /root
|
|
- run: ls -la /
|
|
- run: ls -la /__w
|
|
- run: git --version
|
|
- run: rustc --version
|
|
- run: cargo --version
|
|
- run: python --version
|
|
- run: python -c 'import json; print(json)'
|
|
- run: mkdir /build
|
|
# - run: "echo Flags: ${{ github.event.inputs.flags }}"
|
|
# - run: echo $HOME
|
|
# - run: echo $PATH
|
|
# - run: echo $GITHUB_WORKSPACE
|
|
# - run: /usr/bin/df -h
|
|
# - run: id
|
|
# - run: pwd
|
|
- run: echo GITHUB_WORKSPACE "$GITHUB_WORKSPACE"
|
|
- run: echo RUNNER_WORKSPACE "$RUNNER_WORKSPACE"
|
|
- run: echo github.workspace ${{github.workspace}}
|
|
- run: echo runner.workspace ${{runner.workspace}}
|
|
- run: echo "gh=$GITHUB_WORKSPACE" >> "$GITHUB_OUTPUT"
|
|
id: wdset
|
|
- run: find "$GITHUB_WORKSPACE"
|
|
# - uses: actions/checkout@v4
|
|
# with:
|
|
# repository: paulscherrerinstitute/daqbuffer.git
|
|
# ref: dev
|
|
# path: build
|
|
# - uses: actions/checkout@v4
|
|
# with:
|
|
# repository: paulscherrerinstitute/daqingest.git
|
|
# path: build
|
|
- run: mkdir -p build
|
|
working-directory: ${{steps.wdset.outputs.gh}}
|
|
- run: git clone --branch dev https://github.com/paulscherrerinstitute/daqbuffer.git
|
|
working-directory: ${{steps.wdset.outputs.gh}}/build
|
|
- run: git clone https://github.com/paulscherrerinstitute/daqingest.git
|
|
working-directory: ${{steps.wdset.outputs.gh}}/build
|
|
- run: git reset --hard $GITHUB_SHA
|
|
working-directory: ${{steps.wdset.outputs.gh}}/build/daqingest
|
|
# - run: ls -la $GITHUB_WORKSPACE
|
|
# - run: find $GITHUB_WORKSPACE -type f -and \( -name \*.rs -or -name \*.toml \)
|
|
# - run: find ${{steps.wdset.outputs.gh}} -type f -and \( -name \*.rs -or -name \*.toml \)
|
|
# working-directory: ${{steps.wdset.outputs.gh}}/build
|
|
- run: mkdir -p target/release && cp /usr/bin/cat target/release/daqingest
|
|
working-directory: ${{steps.wdset.outputs.gh}}/build/daqingest/
|
|
if: false
|
|
- run: cargo build --release
|
|
working-directory: ${{steps.wdset.outputs.gh}}/build/daqingest
|
|
- run: ls -l
|
|
working-directory: ${{steps.wdset.outputs.gh}}/build/daqingest/target/release
|
|
- run: ./daqingest version
|
|
working-directory: ${{steps.wdset.outputs.gh}}/build/daqingest/target/release
|
|
# - run: echo "daqingest_version=0.0.0-alpha.00" >> "$GITHUB_OUTPUT"
|
|
# id: daqingest_version_set
|
|
- run: echo $(${{steps.wdset.outputs.gh}}/build/daqingest/target/release/daqingest version) > daqver && echo "daqingest_version=$(cat daqver)" >> "$GITHUB_OUTPUT" && echo "DAQVER=$(cat daqver)" >> "$GITHUB_ENV"
|
|
id: daqingest_version_set
|
|
- run: "echo version: TT$(cat daqver)TT"
|
|
- run: "echo 'version: [${{steps.daqingest_version_set.outputs.daqingest_version}}]'"
|
|
- run: "echo 'version: [${{env.DAQVER}}]'"
|
|
- run: echo "SELFPKG=daqingest-$DAQVER" >> $GITHUB_ENV
|
|
- run: echo "SELFPKGTGT=$SELFPKG-amd64-rhel7" >> $GITHUB_ENV
|
|
- run: echo DAQVER ..$DAQVER..
|
|
- run: echo SELFPKG ..$SELFPKG..
|
|
- run: echo SELFPKGTGT ..$SELFPKGTGT..
|
|
- run: mkdir $SELFPKGTGT
|
|
- run: cp ${{steps.wdset.outputs.gh}}/build/daqingest/target/release/daqingest $SELFPKGTGT/daqingest
|
|
- run: tar -czf $SELFPKGTGT.tar.gz $SELFPKGTGT
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{env.SELFPKGTGT}}
|
|
path: ${{steps.wdset.outputs.gh}}/build/daqingest/target/release/daqingest
|
|
- run: echo "{\"tag_name\":\"$DAQVER\", \"name\":\"$SELFPKG\", \"draft\":false, \"prerelease\":false}" > create-rel.json
|
|
- run: "curl -v -o rel.json -L -X POST -H content-type:application/json -H 'accept:application/vnd.github+json' -H 'authorization:bearer ${{secrets.github_token}}' -H x-github-api-version:2022-11-28 -T create-rel.json https://api.github.com/repos/paulscherrerinstitute/daqingest/releases"
|
|
- run: cat rel.json
|
|
- run: "RELID=$(python -c 'import json; x=json.load(open(\"rel.json\")); print(x[\"id\"])') && curl -v -o relass.json -L -X POST -H content-type:application/octet-stream -H 'accept:application/vnd.github+json' -H 'authorization:bearer ${{secrets.github_token}}' -H x-github-api-version:2022-11-28 -T ${{steps.wdset.outputs.gh}}/build/daqingest/target/release/daqingest https://uploads.github.com/repos/paulscherrerinstitute/daqingest/releases/$RELID/assets?name=$SELFPKGTGT"
|
|
if: false
|
|
- run: "RELID=$(python -c 'import json; x=json.load(open(\"rel.json\")); print(x[\"id\"])') && curl -v -o relass.json -L -X POST -H content-type:application/octet-stream -H 'accept:application/vnd.github+json' -H 'authorization:bearer ${{secrets.github_token}}' -H x-github-api-version:2022-11-28 -T $SELFPKGTGT.tar.gz https://uploads.github.com/repos/paulscherrerinstitute/daqingest/releases/$RELID/assets?name=$SELFPKGTGT.tar.gz"
|
|
- run: cat relass.json
|