courses 0.9.4

A publishing system for interactive content
Documentation
# Souped up with the arm/msvc builds from: https://github.com/capeprivacy/nitrogen/blob/main/.github/workflows/release.yaml
name: Release

on:
  release:
    types: [created, prereleased]
  workflow_dispatch:


jobs:
  release:
    name: release ${{ matrix.target }}
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-pc-windows-gnu
            archive: tar.gz
          - target: x86_64-unknown-linux-musl
            archive: tar.gz tar.xz
          - target: x86_64-apple-darwin
            archive: tar.gz
    steps:
      - uses: actions/checkout@master
      - name: Compile and release
        uses: rust-build/rust-build.action@v1.3.2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          RUSTTARGET: ${{ matrix.target }}
          ARCHIVE_TYPES: ${{ matrix.archive }}
          TOOLCHAIN_VERSION: 1.72.0
#      - name: Upload artifact
#        uses: actions/upload-artifact@v3
#        with:
#          name: Binary
#          path: |
#            ${{ steps.compile.outputs.BUILT_ARCHIVE }}
#            ${{ steps.compile.outputs.BUILT_CHECKSUM }}
#  windows-msvc-release:
#    name: release windows msvc
#    runs-on: windows-latest
#    steps:
#      - uses: actions/checkout@master
#      - name: Build
#        run: |
#          cargo build --release
#      - name: tar
#        run: tar --directory=target/release -cf archive.tar.gz courses.exe
#      - name: upload
#        run: |
#          $id = gh api -H "Accept: application/vnd.github+json" /repos/coursesproject/courses/releases/tags/${{ github.ref_name }} --jq .id
#          curl --fail-with-body -sS  -X POST --data-binary "@archive.tar.gz" -H 'Content-Type: application/octet-stream' -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "https://uploads.github.com/repos/coursesproject/courses/releases/$id/assets?name=courses_${{ github.ref_name }}_x86_64-pc-windows-msvc.tar.gz"
#        env:
#          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#  macos-arm-release:
#    name: release mac os arm release
#    runs-on: macos-12
#    steps:
#      - uses: actions/checkout@master
#      - name: check toolchain
#        run: rustup default
#      - name: Build
#        run: |
#          rustup toolchain install stable-aarch64-apple-darwin
#          rustup target add aarch64-apple-darwin
#          cargo build --release --target aarch64-apple-darwin
#      - name: tar
#        run: tar --directory=target/aarch64-apple-darwin/release -cf archive.tar.gz courses
#      - name: upload
#        run: |
#          id=$(gh api -H "Accept: application/vnd.github+json" /repos/coursesproject/courses/releases/tags/${{ github.ref_name }} --jq .id)
#          curl --fail-with-body -sS  -X POST --data-binary @"archive.tar.gz" -H 'Content-Type: application/octet-stream' -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://uploads.github.com/repos/coursesproject/courses/releases/$id/assets?name=courses_${{ github.ref_name }}_aarch64-apple-darwin.tar.gz"
#        env:
#          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}