Skip to content

Commit f68bdb3

Browse files
Refactor release workflow to use environment variable
1 parent 3f30c34 commit f68bdb3

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,30 @@ jobs:
99
release:
1010
name: Release
1111
runs-on: ubuntu-latest
12+
env:
13+
PACKAGE_NAME: "shifter-github-hosting-plugin-sample"
1214

1315
steps:
1416
- uses: actions/checkout@v4
1517

16-
# composer.json がある場合のみ有効化する
17-
# - name: composer install
18-
# run: composer install
18+
- name: composer install
19+
run: composer install --no-dev --prefer-dist --no-progress --no-interaction
1920

2021
- name: get tag name
2122
id: tag
2223
run: echo "tagname=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2324

2425
- name: add version
25-
env:
26-
PACKAGE_NAME: "shifter-github-hosting-plugin-sample"
2726
run: sed -i -e "s/{release version}/${{ steps.tag.outputs.tagname }}/g" ${PACKAGE_NAME}.php
2827

2928
- name: create archive
3029
env:
31-
PACKAGE_NAME: "shifter-github-hosting-plugin-sample"
3230
FILES_TO_ARCHIVE: "*.php *.md LICENSE vendor/*"
3331
run: zip -r ${PACKAGE_NAME}.zip ${FILES_TO_ARCHIVE}
3432

3533
- name: upload to github release
3634
uses: softprops/action-gh-release@v2
37-
env:
38-
PACKAGE_NAME: "shifter-github-hosting-plugin-sample"
3935
with:
4036
tag_name: ${{ steps.tag.outputs.tagname }}
4137
name: "${{ env.PACKAGE_NAME }} ${{ steps.tag.outputs.tagname }}"
4238
files: ${{ env.PACKAGE_NAME }}.zip
43-

0 commit comments

Comments
 (0)