From c0f0a87d7269c5bc1150c7e9a33db7f5b0a62c3e Mon Sep 17 00:00:00 2001 From: Paul Sanders Date: Sat, 1 Jun 2024 15:46:10 -0400 Subject: [PATCH] Update publish action --- .github/workflows/publish.yml | 18 ++++++ .github/workflows/publish_binaries.yml | 78 -------------------------- 2 files changed, 18 insertions(+), 78 deletions(-) create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/publish_binaries.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..bd5376e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,18 @@ +on: + release: + types: + - published + +name: Publish binaries to release + +jobs: + cargo-publish: + name: Publish to crates.io + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + - name: Publish + run: cargo publish --token ${{ secrets.CARGO_API_TOKEN }} diff --git a/.github/workflows/publish_binaries.yml b/.github/workflows/publish_binaries.yml deleted file mode 100644 index 252e842..0000000 --- a/.github/workflows/publish_binaries.yml +++ /dev/null @@ -1,78 +0,0 @@ -on: - release: - types: - - published - -name: Publish binaries to release - -jobs: - publish: - name: Publish for ${{ matrix.os }} ${{ matrix.target }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - artifact_name: prelude-xml-parser - asset_name: prelude-xml-parser-linux-amd64 - target: x86_64-unknown-linux-gnu - - os: macos-latest - artifact_name: prelude-xml-parser - asset_name: prelude-xml-parser-macos-amd64 - target: x86_64-apple-darwin - - os: macos-latest - artifact_name: prelude-xml-parser - asset_name: prelude-xml-parser-macos-aarch64 - target: aarch64-apple-darwin - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - - name: Add target - run: rustup target add ${{ matrix.target }} - - name: Build - run: cargo build --release --locked --target ${{ matrix.target }} - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN}} - file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }} - asset_name: ${{ matrix.asset_name }} - tag: ${{ github.ref }} - cargo-publish: - name: Publish to crates.io - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - - name: Publish - run: cargo publish --token ${{ secrets.CARGO_API_TOKEN }} - build-deb: - name: Build and upload deb package - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - - name: Install packages - run: sudo apt-get install build-essential pkg-config libssl-dev - - name: Install cargo-deb - run: cargo install cargo-deb - - name: Create package - id: create-deb - run: | - cargo deb --deb-revision="" # --deb-revision="" removes the -1 post tag - cd target/debian - echo "DEB_FILE=$(find prelude-xml-parser*_*.deb)" >> "$GITHUB_OUTPUT" - - name: Upload deb package to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN}} - file: target/debian/${{ steps.create-deb.outputs.DEB_FILE }} - asset_name: ${{ steps.create-deb.outputs.DEB_FILE }} - tag: ${{ github.ref }}