Skip to content

Commit b1a269e

Browse files
authored
Update permissions on publish-release.yml
1 parent 796e173 commit b1a269e

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

.github/workflows/publish-release.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
MLM_LICENSE_TOKEN: ${{ secrets.MATLAB_BATCH_TOKEN }}
1111

1212
permissions:
13-
contents: read
13+
contents: write
1414

1515
jobs:
1616
compile-and-deploy:
@@ -117,10 +117,10 @@ jobs:
117117
pip install build
118118
pip install numpy
119119
120-
# - name: Setup python version
121-
# if: ${{ matrix.main }}
122-
# run: |
123-
# sed -i 's/\(version = "[^"]*\)"/version = "${{ github.ref_name }}"/' pyproject.toml
120+
- name: Setup python version
121+
if: ${{ matrix.main }}
122+
run: |
123+
sed -i 's/\(version = "[^"]*\)"/version = "${{ github.ref_name }}"/' pyproject.toml
124124
125125
- name: Add Matlab version specifier
126126
if: ${{ !matrix.main }}
@@ -149,21 +149,21 @@ jobs:
149149
- name: Build package
150150
run: python -m build --sdist --wheel
151151

152-
# - name: Detect Pre-release
153-
# shell: bash
154-
# run: |
155-
# if echo "${{ github.ref_name }}" | grep -q '^[0-9][0-9]\.[0-9][0-9]\.[A-Za-z]'; then
156-
# echo "PRERELEASE=true" >> $GITHUB_ENV
157-
# else
158-
# echo "PRERELEASE=false" >> $GITHUB_ENV
159-
# fi
160-
# echo PRERELEASE=${{ env.PRERELEASE }}
152+
- name: Detect Pre-release
153+
shell: bash
154+
run: |
155+
if echo "${{ github.ref_name }}" | grep -q '^[0-9][0-9]\.[0-9][0-9]\.[A-Za-z]'; then
156+
echo "PRERELEASE=true" >> $GITHUB_ENV
157+
else
158+
echo "PRERELEASE=false" >> $GITHUB_ENV
159+
fi
160+
echo PRERELEASE=${{ env.PRERELEASE }}
161161
162-
# - name: Release package
163-
# uses: softprops/action-gh-release@v2
164-
# with:
165-
# prerelease: ${{ env.PRERELEASE }}
166-
# files: ./dist/spm_python*.whl
162+
- name: Release package
163+
uses: softprops/action-gh-release@v2
164+
with:
165+
prerelease: ${{ env.PRERELEASE }}
166+
files: ./dist/spm_python*.whl
167167

168168
- name: Publish package
169169
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29

0 commit comments

Comments
 (0)