From 37a3fb635afd4d0ab4ccdada9e177debd97e9b52 Mon Sep 17 00:00:00 2001 From: Joshua Taylor Date: Mon, 2 Dec 2024 21:28:12 -0600 Subject: [PATCH] Switch to direct builds --- .github/FUNDING.yml | 4 - .github/ISSUE_TEMPLATE/bug_report.md | 38 ---- .github/ISSUE_TEMPLATE/feature_request.md | 20 --- .github/workflows/release.yml | 200 +++------------------- .github/workflows/rust-clippy.yml | 54 ------ .github/workflows/rust.yml | 22 --- compose.yaml | 3 +- 7 files changed, 24 insertions(+), 317 deletions(-) delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/workflows/rust-clippy.yml delete mode 100644 .github/workflows/rust.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 09c6e2ff..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,4 +0,0 @@ -# These are supported funding model platforms - -github: szabodanika - diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index dd84ea78..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7d..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df3b026b..f8fde906 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,196 +1,42 @@ -name: GitHub and Docker Release - +name: CI on: push: - tags: - - v[0-9]+.[0-9]+.[0-9]+* + branches: [ master ] jobs: - release: - name: Publish to Github Relases - outputs: - rc: ${{ steps.check-tag.outputs.rc }} - - strategy: - matrix: - include: - - target: aarch64-unknown-linux-musl - os: ubuntu-latest - use-cross: true - cargo-flags: "" - - target: aarch64-apple-darwin - os: macos-latest - use-cross: true - cargo-flags: "" - - target: aarch64-pc-windows-msvc - os: windows-latest - use-cross: true - cargo-flags: "--no-default-features" - - target: x86_64-apple-darwin - os: macos-latest - cargo-flags: "" - - target: x86_64-pc-windows-msvc - os: windows-latest - cargo-flags: "" - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - use-cross: true - cargo-flags: "" - - target: i686-unknown-linux-musl - os: ubuntu-latest - use-cross: true - cargo-flags: "" - - target: i686-pc-windows-msvc - os: windows-latest - use-cross: true - cargo-flags: "" - - target: armv7-unknown-linux-musleabihf - os: ubuntu-latest - use-cross: true - cargo-flags: "" - - target: arm-unknown-linux-musleabihf - os: ubuntu-latest - use-cross: true - cargo-flags: "" - - target: mips-unknown-linux-musl - os: ubuntu-latest - use-cross: true - cargo-flags: "--no-default-features" - - target: mipsel-unknown-linux-musl - os: ubuntu-latest - use-cross: true - cargo-flags: "--no-default-features" - - target: mips64-unknown-linux-gnuabi64 - os: ubuntu-latest - use-cross: true - cargo-flags: "--no-default-features" - - target: mips64el-unknown-linux-gnuabi64 - os: ubuntu-latest - use-cross: true - cargo-flags: "--no-default-features" - runs-on: ${{matrix.os}} + build: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Check Tag - id: check-tag - shell: bash - run: | - tag=${GITHUB_REF##*/} - echo "::set-output name=version::$tag" - if [[ "$tag" =~ [0-9]+.[0-9]+.[0-9]+$ ]]; then - echo "::set-output name=rc::false" - else - echo "::set-output name=rc::true" - fi - - - - name: Install Rust Toolchain Components - uses: actions-rs/toolchain@v1 - with: - override: true - target: ${{ matrix.target }} - toolchain: stable - profile: minimal # minimal component installation (ie, no documentation) - - - name: Install OpenSSL - if: runner.os == 'Linux' - run: sudo apt-get install -y libssl-dev - - - name: Show Version Information (Rust, cargo, GCC) - shell: bash - run: | - gcc --version || true - rustup -V - rustup toolchain list - rustup default - cargo -V - rustc -V - - - name: Build - uses: actions-rs/cargo@v1 - with: - use-cross: ${{ matrix.use-cross }} - command: build - args: --locked --release --target=${{ matrix.target }} ${{ matrix.cargo-flags }} - - - name: Build Archive - shell: bash - id: package - env: - target: ${{ matrix.target }} - version: ${{ steps.check-tag.outputs.version }} - run: | - set -euxo pipefail - - bin=${GITHUB_REPOSITORY##*/} - src=`pwd` - dist=$src/dist - name=$bin-$version-$target - executable=target/$target/release/$bin - - if [[ "$RUNNER_OS" == "Windows" ]]; then - executable=$executable.exe - fi + - name: Correct env + run: + echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} - mkdir $dist - cp $executable $dist - cd $dist + - name: Check out code into the proper directory + uses: actions/checkout@v1 - if [[ "$RUNNER_OS" == "Windows" ]]; then - archive=$dist/$name.zip - 7z a $archive * - echo "::set-output name=archive::`pwd -W`/$name.zip" - else - archive=$dist/$name.tar.gz - tar czf $archive * - echo "::set-output name=archive::$archive" - fi - - - name: Publish Archive - uses: softprops/action-gh-release@v0.1.15 - if: ${{ startsWith(github.ref, 'refs/tags/') }} - with: - draft: false - files: ${{ steps.package.outputs.archive }} - prerelease: ${{ steps.check-tag.outputs.rc == 'true' }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - docker: - name: Publish to Docker Hub - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - needs: release - steps: - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ secrets.DOCKERHUB_REPO }} - tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - name: Set up QEMU + id: qemu uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + id: buildx uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub + + - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build container uses: docker/build-push-action@v2 with: + context: . + push: true + tags: ghcr.io/${{ env.REPO }}:latest build-args: | REPO=${{ github.repository }} VER=${{ github.ref_name }} - platforms: | - linux/amd64 - linux/arm64 - push: ${{ github.ref_type == 'tag' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 \ No newline at end of file diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml deleted file mode 100644 index 12689f88..00000000 --- a/.github/workflows/rust-clippy.yml +++ /dev/null @@ -1,54 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# rust-clippy is a tool that runs a bunch of lints to catch common -# mistakes in your Rust code and help improve your Rust code. -# More details at https://github.com/rust-lang/rust-clippy -# and https://rust-lang.github.io/rust-clippy/ - -name: rust-clippy analyze - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '35 12 * * 5' - -jobs: - rust-clippy-analyze: - name: Run rust-clippy analyzing - runs-on: ubuntu-latest - permissions: - contents: read - security-events: write - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1 - with: - profile: minimal - toolchain: stable - components: clippy - override: true - - - name: Install required cargo - run: cargo install clippy-sarif sarif-fmt - - - name: Run rust-clippy - run: - cargo clippy - --all-features - --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt - continue-on-error: true - - - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v1 - with: - sarif_file: rust-clippy-results.sarif - wait-for-processing: true diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 7eab1a65..00000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Rust - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose diff --git a/compose.yaml b/compose.yaml index d08b7b08..59479c58 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,7 +1,6 @@ services: microbin: - #image: danielszabo99/microbin:latest - build: . + image: ghcr.io/minecrafthopper/microbin:latest restart: always ports: - "${MICROBIN_PORT}:8080"