Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenIceage authored Jul 18, 2024
1 parent 809fdf1 commit 8115f0c
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ jobs:
PROJECT: home:ChHuang
PACKAGE: python-osc-tiny
steps:
- uses: actions/checkout@master
- name: Get latest release tag
id: get_latest_release
run: |
LATEST_TAG=$(git describe --tags --abbrev=0)
LATEST_TAG=${LATEST_TAG#v}
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
- name: Install osc
run: |
sudo apt-get update -y
Expand All @@ -26,8 +33,6 @@ jobs:
user = ${{ secrets.OSC_USER }}
pass = ${{ secrets.OSC_PASS }}
EOF
- name: Print file content
run: cat $HOME/.oscrc
- name: checkout package
run: |
osc branchco $PROJECT $PACKAGE
Expand All @@ -37,10 +42,8 @@ jobs:
- name: Fetch tarball from PyPI
id: fetch-tarball
run: |
VERSION=${{ github.event.release.tag_name }}
FILE_NAME=osc-tiny-$VERSION.tar.gz
FILE_URL="https://files.pythonhosted.org/packages/source/o/osc-tiny/osc_tiny-$VERSION.tar.gz -O $FILE_NAME"
echo "::set-output name=version::$VERSION"
FILE_NAME=osc-tiny-$LATEST_TAG.tar.gz
FILE_URL="https://files.pythonhosted.org/packages/source/o/osc-tiny/osc_tiny-$LATEST_TAG.tar.gz -O $FILE_NAME"
while [ ! -f "$FILE_NAME" ]; do
echo "File not found. Downloading..."
Expand All @@ -54,13 +57,13 @@ jobs:
- name: Update version in spec file
run: |
sed -i "s/^Version:.*/Version: ${{ steps.fetch-tarball.outputs.version }}/" *.spec
sed -i "s/^Version:.*/Version: $LATEST_TAG/" *.spec
- name: Commit and push changes
run: |
osc vc -m 'Update to version ${{ steps.fetch-tarball.outputs.version }}'
osc commit -m "Update to version ${{ steps.fetch-tarball.outputs.version }}"
osc vc -m 'Update to version $LATEST_TAG'
osc commit -m "Update to version $LATEST_TAG"
- name: Submit changes to OBS
run: |
osc submitrequest -m "Update package to version ${{ steps.fetch-tarball.outputs.version }}"
osc submitrequest -m "Update package to version $LATEST_TAG"

0 comments on commit 8115f0c

Please sign in to comment.