Compare commits

...

11 commits

Author SHA1 Message Date
737fe3aa7a
fixaction): appimage run needs an env var
All checks were successful
/ Move action v0 tag (push) Successful in 21s
2024-12-27 01:43:34 +01:00
15a3493a4e
fix(action): enable fuse
All checks were successful
/ Move action v0 tag (push) Successful in 25s
2024-12-27 01:36:24 +01:00
d926e3d3f1
fix(worflow): fix step title 2024-12-27 01:33:04 +01:00
1917eeb3ca
typo
All checks were successful
/ Move action v0 tag (push) Successful in 15s
2024-12-27 01:31:55 +01:00
01f1e3612f
misc for test 2024-12-27 01:30:49 +01:00
14c4328fdd
fix(worflow): no worflow were run when action.yaml was changed 2024-12-27 01:29:44 +01:00
f44b83d854
install AppImage dependencies 2024-12-27 01:26:53 +01:00
5c2fefee0d
misc fixes 2024-12-27 01:01:34 +01:00
8bc10b1486
chore(workflow): fix git tags creation 2024-12-27 00:55:55 +01:00
8b45d00667
feat: add action definition 2024-12-27 00:49:26 +01:00
f7a2c60a63
test workflow 2024-12-27 00:40:29 +01:00
3 changed files with 83 additions and 25 deletions

View file

@ -2,8 +2,8 @@ on:
push:
branches:
- main
#paths:
# - 'src/*.v'
paths:
- 'src/*.v'
jobs:
build:
name: Build and upload binary
@ -23,30 +23,28 @@ jobs:
/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
set -e
VERSION="$(date +'%y.%m.%d').$(git rev-parse --short HEAD)"
echo Download jq
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
echo Create a tag
git tag "$VERSION"
git push --tags --force
# Create a release
#curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
# -H "Content-Type: application/json" \
# --data '{"name": "'$VERSION'", "tag": "'$VERSION'"}' \
# "https://code.bcarlin.net/api/repos/actions/setup-browser/releases"
echo Create a release
OUT=$(curl --silent -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
--data '{"name": "'$VERSION'", "tag_name": "'$VERSION'"}' \
"$GITHUB_API_URL/repos/actions/setup-browser/releases" \
| tee /dev/stderr)
#REL_ID=$(curl -H "Authorization: token $GITHUB_TOKEN" "https://forgejo.example.com/api/repos/actions/setup-browser/releases/latest" | ./jq .id)
UP_URL=$(echo "$OUT" | ./jq -r .upload_url )
# 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
curl -v --header "Authorization: token $GITHUB_TOKEN" \
--upload-file setup-browser \
"https://code.bcarlin.net/api/packages/actions/generic/setup-browser/$VERSION/setup-browser"
echo Add the binary to the release
curl --silent -X 'POST' --header "Authorization: token $GITHUB_TOKEN" \
"$UP_URL" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'attachment=@setup-browser'

View file

@ -0,0 +1,18 @@
on:
push:
branches:
- main
paths:
- 'src/*.v'
- action.yaml
jobs:
build:
name: Move action v0 tag
runs-on: docker
steps:
- uses: actions/checkout@v4
- name: move v0 tag
run: |
set -e
git tag -f v0
git push --tags --force

42
action.yaml Normal file
View file

@ -0,0 +1,42 @@
name: 'Setup Browser'
description: |
Installs a browser from various sources to use for tests.
Are supported:
- Ungoogled Chromium (`uchromium`), available versions are listed
[here](https://ungoogled-software.github.io/ungoogled-chromium-binaries/releases/appimage/64bit/).
inputs:
target:
description: |
The browser and ersion to install in the form `BROWSER:VERSION`.
The version is optional.
required: true
install-path:
description: |
The path where the binary should be installed.
The path is added to the system PATH for subsequent steps.
runs:
using: "composite"
steps:
- name: Download setup-browser
working-directory: ${{ github.action_path }}
run: |
wget -q https://code.bcarlin.net/actions/setup-browser/releases/download/latest/setup-browser
chmod +x setup-browser
shell: bash
- name: Download the browser
working-directory: ${{ github.action_path }}
run: |
set -x
INSTALL_PATH=${INSTALL_PATH:-/opt/${TARGET%%:*}}
./setup-browser install \
-cache-path cache \
-install-to "$INSTALL_PATH" \
"${TARGET}"
echo "$(dirname "$INSTALL_PATH")" >> "$GITHUB_PATH"
echo "APPIMAGE_EXTRACT_AND_RUN=true" >> "$GITHUB_ENV"
shell: bash
env:
TARGET: ${{ inputs.target }}
INSTALL_PATH: ${{ inputs.install-path }}