From 71814cbdc9fc908208a23ef43af8dc7d71d9eab2 Mon Sep 17 00:00:00 2001 From: Florian Gabsteiger Date: Sun, 22 Nov 2020 14:28:09 +0100 Subject: [PATCH 1/2] build via github actions --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8288253 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: continuous integration + +on: + push: + branches: [master, feat/*] + tags: + - v* + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: setup node + uses: actions/setup-node@v1 + - name: install dependencies + run: | + npm install + cd backend + npm install + sudo npm install -g @angular/cli + - name: build + run: ng build --prod + - name: prepare artifact upload + shell: pwsh + run: | + New-Item -Name build -ItemType Directory + New-Item -Path build -Name youtubedl-material -ItemType Directory + Copy-Item -Path ./backend/appdata -Recurse -Destination ./build/youtubedl-material + Copy-Item -Path ./backend/audio -Recurse -Destination ./build/youtubedl-material + Copy-Item -Path ./backend/authentication -Recurse -Destination ./build/youtubedl-material + Copy-Item -Path ./backend/public -Recurse -Destination ./build/youtubedl-material + Copy-Item -Path ./backend/subscriptions -Recurse -Destination ./build/youtubedl-material + Copy-Item -Path ./backend/video -Recurse -Destination ./build/youtubedl-material + Copy-Item -Path ./backend/*.js -Destination ./build/youtubedl-material + Copy-Item -Path ./backend/*.json -Destination ./build/youtubedl-material + - name: upload build artifacts + uses: actions/upload-artifact@v1 + with: + name: youtubedl-material + path: build + From d93481640c3096237b29c7b4255c27e02285bb4b Mon Sep 17 00:00:00 2001 From: Florian Gabsteiger Date: Sun, 22 Nov 2020 15:05:29 +0100 Subject: [PATCH 2/2] automated release creation for tagged commits --- .github/workflows/build.yml | 51 +++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8288253..9eb71be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,11 +35,58 @@ jobs: Copy-Item -Path ./backend/public -Recurse -Destination ./build/youtubedl-material Copy-Item -Path ./backend/subscriptions -Recurse -Destination ./build/youtubedl-material Copy-Item -Path ./backend/video -Recurse -Destination ./build/youtubedl-material + New-Item -Path ./build/youtubedl-material -Name users Copy-Item -Path ./backend/*.js -Destination ./build/youtubedl-material Copy-Item -Path ./backend/*.json -Destination ./build/youtubedl-material - - name: upload build artifacts + - name: upload build artifact uses: actions/upload-artifact@v1 with: name: youtubedl-material path: build - + release: + runs-on: ubuntu-latest + needs: build + if: contains(github.ref, '/tags/v') + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: YoutubeDL-Material ${{ github.ref }} + body: | + # New features + # Minor additions + # Bug fixes + draft: true + prerelease: false + - name: download build artifact + uses: actions/download-artifact@v1 + with: + name: youtubedl-material + path: ${{runner.temp}}/youtubedl-material + - name: prepare release asset + shell: pwsh + run: Compress-Archive -Path ${{runner.temp}}/youtubedl-material -DestinationPath youtubedl-material-${{ github.ref }}.zip + - name: upload build asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./youtubedl-material-${{ github.ref }}.zip + asset_name: youtubedl-material-${{ github.ref }}.zip + asset_content_type: application/zip + - name: upload docker-compose asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./docker-compose.yml + asset_name: docker-compose.yml + asset_content_type: text/plain