2024-12-25 04:33:01 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2024-12-26 00:54:19 +01:00
|
|
|
#paths:
|
|
|
|
# - 'src/*.v'
|
2024-12-25 04:33:01 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build and upload binary
|
|
|
|
runs-on: docker
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install v
|
|
|
|
run: |
|
|
|
|
wget -q https://github.com/vlang/v/releases/latest/download/v_linux.zip
|
|
|
|
pushd /tmp
|
|
|
|
unzip -q $GITHUB_WORKSPACE/v_linux.zip
|
|
|
|
popd
|
|
|
|
rm v_linux.zip
|
|
|
|
/tmp/v/v version
|
|
|
|
- name: Build setup-browser
|
|
|
|
run: |
|
|
|
|
/tmp/v/v -prod .
|
|
|
|
- name: Upload binary as generic package and create a release
|
|
|
|
run: |
|
|
|
|
VERSION="$(date +'%y.%m.%d').$GITHUB_REF_NAME"
|
|
|
|
#wget -q https://github.com/jqlang/jq/releases/latest/download/jq-linux-amd64 -o jq
|
|
|
|
#chmod +x jq
|
|
|
|
|
|
|
|
# Create a tag
|
|
|
|
#git tag "$VERSION"
|
|
|
|
#git push --tags
|
|
|
|
|
|
|
|
# Create a release
|
|
|
|
#curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
|
|
|
|
# -H "Content-Type: application/json" \
|
|
|
|
# --data '{"name": "'$VERSION'", "tag": "'$VERSION'"}' \
|
2024-12-26 00:54:19 +01:00
|
|
|
# "https://code.bcarlin.net/api/repos/actions/setup-browser/releases"
|
2024-12-25 04:33:01 +01:00
|
|
|
|
|
|
|
#REL_ID=$(curl -H "Authorization: token $GITHUB_TOKEN" "https://forgejo.example.com/api/repos/actions/setup-browser/releases/latest" | ./jq .id)
|
|
|
|
|
|
|
|
# Add the binary to the release
|
|
|
|
#curl -X 'POST' --header "Authorization: token $GITHUB_TOKEN" \
|
|
|
|
# "https://code.bcarlin.net/api/v1/repos/actions/setup-browser/releases/$REL_ID/assets?name=setup-browser" \
|
|
|
|
# -H 'accept: application/json' \
|
|
|
|
# -H 'Content-Type: multipart/form-data' \
|
|
|
|
# -F 'external_url='
|
|
|
|
|
|
|
|
# Upload the binary as a generic package
|
2024-12-26 00:54:19 +01:00
|
|
|
curl -v --header "Authorization: token $GITHUB_TOKEN" \
|
2024-12-25 04:33:01 +01:00
|
|
|
--upload-file setup-browser \
|
2024-12-26 00:54:19 +01:00
|
|
|
"https://code.bcarlin.net/api/packages/actions/generic/setup-browser/$VERSION/setup-browser"
|