From c88a2c3b968e7c231a26d3bdf3e9d373f326e8bd Mon Sep 17 00:00:00 2001 From: Yuriy Larin Date: Fri, 9 Feb 2024 14:44:23 +0200 Subject: [PATCH 1/3] added release.yml --- .github/workflows/release.yml | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..0b721a30f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +on: + release: + types: [created] + push: + + +jobs: + release: + name: release ${{ matrix.target }} (with non-required env) + runs-on: ubuntu-latest + if: github.event_name == 'release' + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-pc-windows-gnu + archive: zip + - target: x86_64-unknown-linux-musl + archive: tar.gz + - target: x86_64-apple-darwin + archive: zip + - target: wasm32-wasi + archive: zip tar.gz + steps: + - uses: actions/checkout@master + - name: Compile and release + uses: rust-build/rust-build.action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + RUSTTARGET: ${{ matrix.target }} + EXTRA_FILES: "README.md" + SRC_DIR: "src" + ARCHIVE_TYPES: ${{ matrix.archive }} +# PRE_BUILD: "pre_build.sh" +# POST_BUILD: "test/post_build.sh" + MINIFY: "yes" + release_without_not_required: + name: release ${{ matrix.target }} + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + target: [x86_64-unknown-linux-musl] + steps: + - uses: actions/checkout@master + - name: Compile and release + uses: rust-build/rust-build.action@master + with: + RUSTTARGET: ${{ matrix.target }} + UPLOAD_MODE: none + - name: Checkout output + run: ls -laR \ No newline at end of file From f4fe35f437f294cab120b5c51fed2ae775ec7cc7 Mon Sep 17 00:00:00 2001 From: Yuriy Larin Date: Fri, 9 Feb 2024 19:47:31 +0200 Subject: [PATCH 2/3] updated release.yml --- .github/workflows/release.yml | 74 +++++++++++++++-------------------- 1 file changed, 32 insertions(+), 42 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b721a30f..dea28e6f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,53 +1,43 @@ +name: Release + +permissions: + contents: write + on: - release: - types: [created] push: - + tags: + - v[0-9]+.* jobs: release: - name: release ${{ matrix.target }} (with non-required env) - runs-on: ubuntu-latest - if: github.event_name == 'release' strategy: - fail-fast: false matrix: + max-parallel: 1 include: - - target: x86_64-pc-windows-gnu - archive: zip - - target: x86_64-unknown-linux-musl - archive: tar.gz - - target: x86_64-apple-darwin - archive: zip - - target: wasm32-wasi - archive: zip tar.gz + - os: ubuntu-latest + artifact_name: ${{ github.event.repository.name }} + asset_name: ${{ github.event.repository.name }}-linux-amd64 + - os: windows-latest + artifact_name: ${{ github.event.repository.name }}.exe + asset_name: ${{ github.event.repository.name }}-windows-amd64.exe + - os: macos-latest + artifact_name: ${{ github.event.repository.name }} + asset_name: ${{ github.event.repository.name }}-macos-amd64 + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@master - - name: Compile and release - uses: rust-build/rust-build.action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Rust + uses: actions-rs/toolchain@v1 with: - RUSTTARGET: ${{ matrix.target }} - EXTRA_FILES: "README.md" - SRC_DIR: "src" - ARCHIVE_TYPES: ${{ matrix.archive }} -# PRE_BUILD: "pre_build.sh" -# POST_BUILD: "test/post_build.sh" - MINIFY: "yes" - release_without_not_required: - name: release ${{ matrix.target }} - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - target: [x86_64-unknown-linux-musl] - steps: - - uses: actions/checkout@master - - name: Compile and release - uses: rust-build/rust-build.action@master + toolchain: stable + - name: Build release + run: >- + cargo build --release + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 with: - RUSTTARGET: ${{ matrix.target }} - UPLOAD_MODE: none - - name: Checkout output - run: ls -laR \ No newline at end of file + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/release/${{ matrix.artifact_name }} + asset_name: ${{ matrix.asset_name }} + tag: ${{ github.ref }} \ No newline at end of file From 62df4963b7f77f5d9c5d705a9ab6106507b592a9 Mon Sep 17 00:00:00 2001 From: Yuriy Larin Date: Fri, 9 Feb 2024 19:54:20 +0200 Subject: [PATCH 3/3] minor update release.yml --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dea28e6f4..cdf54e7e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,6 @@ jobs: release: strategy: matrix: - max-parallel: 1 include: - os: ubuntu-latest artifact_name: ${{ github.event.repository.name }}