diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..3d7b0b30 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,90 @@ +on: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + env: + CARGO_TERM_COLOR: always + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: Run databases + working-directory: ./tests + run: docker-compose up -d + - name: Wait for databases to start + run: sleep 15s + shell: bash + - uses: Swatinem/rust-cache@v1 + - name: Run tests + run: cargo test + + tag: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Determine tag + id: tag + run: echo "::set-output name=release_tag::v$(grep -m 1 'version' Cargo.toml | awk '{print $3}' | tr -d '/"')" + outputs: + release_tag: ${{ steps.tag.outputs.release_tag }} + + build: + needs: tag + name: Build ${{ matrix.target }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-pc-windows-gnu + archive: zip + name: ${{ github.event.repository.name }}_${{ needs.tag.outputs.release_tag }}_x86_64-pc-windows-gnu + - target: x86_64-unknown-linux-musl + archive: tar.gz tar.xz + name: ${{ github.event.repository.name }}_${{ needs.tag.outputs.release_tag }}_x86_64-unknown-linux-musl + - target: x86_64-apple-darwin + archive: zip + name: ${{ github.event.repository.name }}_${{ needs.tag.outputs.release_tag }}_x86_64-apple-darwin + steps: + - uses: actions/checkout@master + - name: Compile builds + id: compile + uses: rust-build/rust-build.action@v1.3.2 + with: + RUSTTARGET: ${{ matrix.target }} + ARCHIVE_TYPES: ${{ matrix.archive }} + ARCHIVE_NAME: ${{ matrix.name }} + UPLOAD_MODE: none + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: torrust-index-backend + path: | + ${{ steps.compile.outputs.BUILT_ARCHIVE }} + ${{ steps.compile.outputs.BUILT_CHECKSUM }} + + release: + needs: [tag, build] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Download builds + uses: actions/download-artifact@v2 + with: + name: torrust-index-backend + path: torrust-index-backend + - name: Release + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true + tag_name: ${{ needs.tag.outputs.release_tag }} + files: | + torrust-index-backend/* + LICENSE diff --git a/LICENSE b/LICENSE index 66ba6c5a..7172b827 100644 --- a/LICENSE +++ b/LICENSE @@ -8,4 +8,6 @@ The two main applicable license to most of its content are: - For Media (Images, etc.) -- [cc-by-sa](https://github.com/torrust/torrust-index/blob/main/licensing/cc-by-sa.md) +We make the exception that projects that distribute this work only need to include the name and version of the license, instead of needing to include them verbatim in the package. + If you want to read more about all the licenses and how they apply please refer to the [contributor agreement](https://github.com/torrust/torrust-index/blob/main/licensing/contributor_agreement_v01.md).