Skip to content

パーソナルアクセストークンにした #8

パーソナルアクセストークンにした

パーソナルアクセストークンにした #8

Workflow file for this run

name: Release
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: checkout
uses: actions/checkout@v3
- name: executable
run: chmod a+x ./gradlew
- name: setup jdk
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'corretto'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: apply version to properties and envs
run: |
export version=$(echo ${GITHUB_REF##*/} | sed 's/^v//')
echo "version=$version" > ./version.properties
echo "VERSION=$version" >> $GITHUB_ENV
- name: build
uses: gradle/gradle-build-action@v2
with:
arguments: build
- name: jar
uses: gradle/gradle-build-action@v2
with:
arguments: :api:jar
- name: release
uses: ncipollo/release-action@v1
with:
name: release ${{ env.VERSION }}
artifacts: "api/build/libs/mfm-*.jar"
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: apply version to repository
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
git add ./version.properties
git commit -m "Apply version to repository $VERSION"
git push