Merge pull request #204 from StarfilesFileSharing/alpha #152
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: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Install Dependencies | |
run: deno install --allow-scripts=npm:[email protected],npm:[email protected],npm:[email protected],npm:[email protected] | |
- name: Compile for linux-x86_64 | |
run: deno run build-linux-x86_64 | |
- name: Compile for linux-arm64 | |
run: deno run build-linux-arm64 | |
- name: Compile for mac-x86_64 | |
run: deno run build-mac-x86_64 | |
- name: Compile for mac-arm64 | |
run: deno run build-mac-arm64 | |
- name: Compile for windows | |
run: deno run build-windows | |
- name: Build for web | |
run: deno --allow-env --allow-read --allow-run build.ts | |
- name: Get Version Number from deno.jsonc | |
id: get_version | |
run: | | |
VERSION=$(deno eval 'console.log(JSON.parse(Deno.readTextFileSync("deno.jsonc")).version)') | |
echo "VERSION=$VERSION" | |
echo "::set-output name=version::$VERSION" | |
- name: Archive Build Artifacts | |
run: | | |
mkdir -p release | |
mv ./build/start-linux-x86_64 ./release/hydrafiles-${{ steps.get_version.outputs.version }}-linux-x86_64 | |
mv ./build/start-linux-arm64 ./release/hydrafiles-${{ steps.get_version.outputs.version }}-linux-arm64 | |
mv ./build/start-mac-x86_64 ./release/hydrafiles-${{ steps.get_version.outputs.version }}-mac-x86_64 | |
mv ./build/start-mac-arm64 ./release/hydrafiles-${{ steps.get_version.outputs.version }}-mac-arm64 | |
mv ./build/start-windows.exe ./release/hydrafiles-${{ steps.get_version.outputs.version }}-windows.exe | |
mv ./build/hydrafiles-web.esm.js ./release/hydrafiles-web.esm.js | |
mv ./build/hydrafiles-web.esm.js.map ./release/hydrafiles-web.esm.js.map | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hydrafiles-${{ steps.get_version.outputs.version }} | |
path: ./release/* | |
- name: log | |
run: echo "Version ${{ steps.get_version.outputs.version }}" | |
- name: Create Tag | |
run: | | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
git tag ${{ steps.get_version.outputs.version }} | |
git push origin ${{ steps.get_version.outputs.version }} | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: Release ${{ steps.get_version.outputs.version }} | |
tag: ${{ steps.get_version.outputs.version }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: "./release/*" | |
allowUpdates: true |