updating ci #12
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: nix-proto-gen | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
jobs: | ||
build-packages: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
version: [23.11] | ||
steps: | ||
- uses: cachix/install-nix-action@v23 | ||
- name: Get branch names | ||
id: branch-name | ||
uses: tj-actions/branch-names@v7 | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: RCMast3r/data_acq | ||
ref: refs/heads/master | ||
- run: nix develop .#ci --override-input nixpkgs github:NixOS/nixpkgs/release-${{ matrix.version}} --command ht_dbc_proto_creator.py | ||
- name: Create Release | ||
id: create_release | ||
run: | | ||
tag="v$(date +'%Y%m%d%H%M%S')" # Unique tag name for the release | ||
response=$(curl -X POST \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/repos/RCMast3r/hytech_dbc_proto/releases \ | ||
-d "{\"tag_name\":\"$tag\",\"name\":\"Release $tag\"}") | ||
upload_url=$(echo "$response" | jq -r '.upload_url' | sed -e 's/{?name,label}//') | ||
echo "::set-output name=upload_url::$upload_url" | ||
# Step to upload hytech.dbc and hytech.proto | ||
- name: Upload files | ||
run: | | ||
curl -X POST \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
-H "Content-Type: application/octet-stream" \ | ||
--data-binary @hytech.dbc \ | ||
"$UPLOAD_URL?name=hytech.dbc" | ||
curl -X POST \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
-H "Content-Type: application/octet-stream" \ | ||
--data-binary @hytech.proto \ | ||
"$UPLOAD_URL?name=hytech.proto" |