Skip to content

Commit 937b2ed

Browse files
authored
Merge pull request #3730 from joshuataylor/feature/github-token
Hopefully fix GitHub token in GitHub Action download for java
2 parents 3a753bd + 0a1df97 commit 937b2ed

File tree

3 files changed

+64
-55
lines changed

3 files changed

+64
-55
lines changed

.github/actions/setup-env/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ runs:
5252
java-version: 21
5353
java-package: 'jdk'
5454
token: ${{ inputs.github-token }}
55+
env:
56+
GITHUB_TOKEN: ${{ inputs.github-token }}
5557

5658
- name: Setup Gradle
5759
id: setup-gradle

.github/workflows/release.yml

Lines changed: 61 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,64 @@
11
name: Release
2-
32
on:
4-
push:
5-
branches:
6-
- main
7-
3+
push:
4+
branches:
5+
- main
86
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

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pluginVersion=22.0.0
1010
pluginRepositoryUrl=https://github.com/KronicDeth/intellij-elixir/
1111
vendorName=Elle Imhoff
1212
vendorEmail=Kronic.Deth@gmail.com
13-
pluginSinceBuild=253.28294.334
13+
pluginSinceBuild=253.28294.1
1414
publishChannels=canary
1515

1616
# Set to True to skip building searchable options, if developing this drastically speeds up build times.

0 commit comments

Comments
 (0)