From 16645170ae876ccd46d85ec93c4826c1025b3f8d Mon Sep 17 00:00:00 2001 From: nanov Date: Wed, 13 Nov 2024 05:00:42 +0200 Subject: [PATCH 1/2] wip: auto buld --- .github/workflows/build.yml | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..33b588c --- /dev/null +++ b/.github/workflows/build.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: "hello" + 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 From b862ca1843346ad0ffc40a95be2ef84d30189f09 Mon Sep 17 00:00:00 2001 From: nanov Date: Wed, 13 Nov 2024 05:22:30 +0200 Subject: [PATCH 2/2] wip: auto build --- .github/workflows/build.yml | 67 +++++++++++++------------------------ 1 file changed, 24 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33b588c..3cd3991 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,53 +1,34 @@ +name: Release + +permissions: + contents: write + on: - release: - types: [created] push: - + tags: + - v[0-9]+.* jobs: - release: - name: release ${{ matrix.target }} (with non-required env) + create-release: 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 }} + - uses: actions/checkout@v4 + - uses: taiki-e/create-gh-release-action@v1 with: - RUSTTARGET: ${{ matrix.target }} - EXTRA_FILES: "README.md" - SRC_DIR: "hello" - 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 }} + # (optional) Path to changelog. + # changelog: CHANGELOG.md + # (required) GitHub token for creating GitHub Releases. + token: ${{ secrets.GITHUB_TOKEN }} + + upload-assets: + needs: create-release 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 + - uses: actions/checkout@v4 + - uses: taiki-e/upload-rust-binary-action@v1 with: - RUSTTARGET: ${{ matrix.target }} - UPLOAD_MODE: none - - name: Checkout output - run: ls -laR + # (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload. + # Note that glob pattern is not supported yet. + bin: rae_cli + # (required) GitHub token for uploading assets to GitHub Releases. + token: ${{ secrets.GITHUB_TOKEN }}