From 150b53aab88e27deb5c953127e743f15d85d5416 Mon Sep 17 00:00:00 2001 From: worthant Date: Tue, 12 Nov 2024 20:41:27 +0300 Subject: [PATCH] :wrench: ci: New release workflow --- .github/workflows/release.yml | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 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 0000000..2361b8a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,64 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - os: macos-latest + target: x86_64-apple-darwin + - os: windows-latest + target: x86_64-pc-windows-msvc + + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up Elixir + uses: actions/setup-elixir@v1 + with: + elixir-version: '1.15.7' + otp-version: '26.0' + + - name: Install dependencies + run: mix deps.get + + - name: Compile code + run: mix compile + + - name: Run release build + env: + MIX_ENV: prod + run: mix release + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: interpolation_cli-${{ matrix.os }} + path: _build/prod/rel/interpolation_cli + + release: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: interpolation_cli-${{ matrix.os }} + path: release + + - name: Create release + uses: softprops/action-gh-release@v1 + with: + files: release/** + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}