# # .gitea/workflows/gitea-release.yaml # # On a version tag (e.g. v1.0): tests, builds Linux and Windows packages, # uploads them to the Gitea generic package registry and creates a Gitea release. # name: "Release" on: push: tags: - 'v*' env: PROJECT_NAME: HanjaKanaMun jobs: release: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v4 - name: Setup Toolchain uses: ./.gitea/actions/setup with: packages: lld zip - name: Set Version run: echo "GAME_VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV" - name: Test run: just test - name: Linux Build run: just package "$GAME_VERSION" - name: Windows Build run: | # Debian/Ubuntu may only ship a versioned lld-link LLD_LINK="$(command -v lld-link || ls /usr/lib/llvm-*/bin/lld-link | sort -V | tail -1)" export LLD_LINK just windows-deps just package-windows "$GAME_VERSION" - name: Upload Artifacts run: | ls -la build for FILE in build/${PROJECT_NAME}_${GAME_VERSION}_*; do NAME="$(basename "$FILE")" echo "Uploading $NAME" curl --fail --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \ --upload-file "$FILE" \ https://gitea.sanplex.xyz/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$NAME done - name: Create Release uses: akkuman/gitea-release-action@v1 env: NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18 with: files: |- build/${{ env.PROJECT_NAME }}_*.tar.gz build/${{ env.PROJECT_NAME }}_*.zip