diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ecac3cd5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: publish +on: + create: + tags: + - 'v*' + workflow_dispatch: + +jobs: + binaries: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0.x' + - run: | + ./build.sh + cd build + tar -cJf "$(basename ./*).tar.xz" -C * . + cd .. + - uses: ncipollo/release-action@v1 + with: + artifacts: "build/*.tar.xz" + allowUpdates: true + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0.x' + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + - run: | + cd docs/.vitepress + tar -cJf docs.tar.xz -C dist . + cd - + - uses: ncipollo/release-action@v1 + with: + artifacts: "docs/.vitepress/docs.tar.xz" + allowUpdates: true diff --git a/build.sh b/build.sh index a6a410bf..9085214d 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,7 @@ fi TARGET=linux-$ARCHITECTURE if [ "$(uname)" = "Darwin" ]; then TARGET=osx-$ARCHITECTURE -elif [ -n "$1" ]; then +elif [ -n "$2" ]; then TARGET=$2-$ARCHITECTURE fi diff --git a/gen-docs.sh b/gen-docs.sh index 64b4c630..400342df 100755 --- a/gen-docs.sh +++ b/gen-docs.sh @@ -3,5 +3,5 @@ dotnet build ./src/Elk.csproj --output ./src/bin/Debug/gen dotnet run --project ./doc-gen/Elk.DocGen.csproj -- ./src/bin/Debug/gen/Elk.xml ./docs/std/ cd docs -npm install +npm ci npm run docs:build