|
1 | 1 | name: Release |
2 | | - |
3 | 2 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - main |
7 | | - |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
8 | 6 | jobs: |
9 | | - test-and-verify: |
10 | | - uses: ./.github/workflows/shared-test.yml |
11 | | - with: |
12 | | - elixir-version: '1.13.4' |
13 | | - otp-version: '24.3.4.6' |
14 | | - |
15 | | - release: |
16 | | - needs: [ test-and-verify ] |
17 | | - runs-on: ubuntu-22.04 |
18 | | - steps: |
19 | | - - name: Checkout |
20 | | - id: checkout |
21 | | - uses: actions/checkout@v6 |
22 | | - |
23 | | - - name: Setup Build Environment |
24 | | - id: setup-env |
25 | | - uses: ./.github/actions/setup-env |
26 | | - with: |
27 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
28 | | - |
29 | | - - name: Build with Gradle |
30 | | - id: build-plugin |
31 | | - run: ./gradlew buildPlugin --no-scan |
32 | | - |
33 | | - - name: Prepare Release |
34 | | - id: prepare-release |
35 | | - run: | |
36 | | - ASSET_PATH=$(ls -1 build/distributions/intellij-elixir-*.zip) |
37 | | - ASSET_NAME=${ASSET_PATH#build/distributions/} |
38 | | - VERSION_SUFFIX=${ASSET_NAME#intellij-elixir-} |
39 | | - TAG="v${VERSION_SUFFIX%.zip}" |
40 | | - echo "ASSET_PATH=$ASSET_PATH" >> $GITHUB_ENV |
41 | | - echo "ASSET_NAME=$ASSET_NAME" >> $GITHUB_ENV |
42 | | - echo "TAG=$TAG" >> $GITHUB_ENV |
43 | | -
|
44 | | - - name: Tag Commit |
45 | | - id: tag-commit |
46 | | - uses: hole19/git-tag-action@master |
47 | | - env: |
48 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
49 | | - |
50 | | - - name: Create Release |
51 | | - id: create-release |
52 | | - uses: softprops/action-gh-release@v2 |
53 | | - with: |
54 | | - tag_name: ${{ env.TAG }} |
55 | | - name: ${{ env.TAG }} |
56 | | - prerelease: true |
57 | | - files: ${{ env.ASSET_PATH }} |
| 7 | + test-and-verify: |
| 8 | + uses: ./.github/workflows/shared-test.yml |
| 9 | + with: |
| 10 | + elixir-version: '1.13.4' |
| 11 | + otp-version: '24.3.4.6' |
| 12 | + |
| 13 | + release: |
| 14 | + needs: [ test-and-verify ] |
| 15 | + runs-on: ubuntu-22.04 |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + id: checkout |
| 19 | + uses: actions/checkout@v6 |
| 20 | + |
| 21 | + - name: Setup Build Environment |
| 22 | + id: setup-env |
| 23 | + uses: ./.github/actions/setup-env |
| 24 | + with: |
| 25 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + |
| 27 | + - name: Build with Gradle |
| 28 | + id: build-plugin |
| 29 | + run: ./gradlew buildPlugin --no-scan |
| 30 | + |
| 31 | + - name: Export ASSET_PATH |
| 32 | + run: echo "ASSET_PATH=$(ls -1 build/distributions/intellij-elixir-*.zip)" >> $GITHUB_ENV |
| 33 | + |
| 34 | + - name: Export ASSET_NAME |
| 35 | + run: echo "ASSET_NAME=${ASSET_PATH#build/distributions/}" >> $GITHUB_ENV |
| 36 | + |
| 37 | + - name: Export TAG |
| 38 | + run: | |
| 39 | + version_suffix_zip=${ASSET_NAME#intellij-elixir-} |
| 40 | + echo "TAG=v${version_suffix_zip%.zip}" >> $GITHUB_ENV |
| 41 | +
|
| 42 | + - name: Tag Commit |
| 43 | + id: tag-commit |
| 44 | + uses: mathieudutour/github-tag-action@v6.2 |
| 45 | + with: |
| 46 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + custom_tag: ${{ env.TAG }} |
| 48 | + |
| 49 | + - name: Create Release |
| 50 | + id: create_release |
| 51 | + uses: softprops/action-gh-release@v2.5.0 |
| 52 | + env: |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + with: |
| 55 | + tag_name: ${{ env.TAG }} |
| 56 | + name: ${{ env.TAG }} |
| 57 | + prerelease: true |
| 58 | + files: ${{ env.ASSET_PATH }} |
| 59 | + fail_on_unmatched_files: true |
| 60 | + |
| 61 | +# - name: Publish |
| 62 | +# env: |
| 63 | +# JET_BRAINS_MARKETPLACE_TOKEN: ${{ secrets.JetBrainsMarketplaceToken }} |
| 64 | +# run: ./gradlew --stacktrace publishPlugin |
0 commit comments