Skip to content

Commit

Permalink
ci: delete unnecessary data
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelillo15 committed Dec 26, 2024
1 parent df1b74c commit 1a8a9a4
Showing 1 changed file with 1 addition and 53 deletions.
54 changes: 1 addition & 53 deletions .github/workflows/modrinth-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,62 +16,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout main branch from GitHub
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Restore last workflow commit from cache
id: cache-last-commit
uses: actions/cache@v4
with:
path: .last_workflow_commit
key: last-workflow-commit

- name: Get last workflow run commit
id: last_run
run: |
if [ -f .last_workflow_commit ]; then
LAST_COMMIT=$(cat .last_workflow_commit)
else
LAST_COMMIT=$(git rev-list --max-parents=0 HEAD)
fi
echo "LAST_COMMIT=$LAST_COMMIT" >> $GITHUB_ENV
- name: Count commits since last run
id: count_commits
run: |
COMMITS=$(git rev-list $LAST_COMMIT..HEAD --count)
echo "commits_count=$COMMITS" >> $GITHUB_ENV
echo "Number of commits since last run: $COMMITS"
- name: Use environment variables
run: |
echo "Last commit: $LAST_COMMIT"
echo "Number of commits: $commits_count"
- name: Store current commit for next run
run: |
git rev-parse HEAD > .last_workflow_commit
echo "Storing current commit: $(cat .last_workflow_commit)"
# Runs a single command using the runners shell
- name: Setting up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Execute Gradle build & publish
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: |
chmod +x gradlew
./gradlew :modrinth
- name: Store current commit for next run
uses: actions/cache@v4
with:
path: .last_workflow_commit
key: last-workflow-commit
./gradlew :modrinth

0 comments on commit 1a8a9a4

Please sign in to comment.