ci: Update actions #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Release" | |
on: | |
push: | |
branches: | |
- 'release/**' | |
jobs: | |
bump: | |
name: "Bump" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
new_version: ${{ steps.tag_version.outputs.new_version }} | |
new_tag: ${{ steps.tag_version.outputs.new_tag }} | |
changelog: ${{ steps.tag_version.outputs.changelog }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Bump version and push tag | |
id: tag_version | |
uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version | |
env: | |
GITHUB_TOKEN: "ds" | |
DEFAULT_BUMP: none | |
RELEASE_BRANCHES: release/.* | |
DRY_RUN: true | |
TAG_CONTEXT: branch | |
release: | |
name: "Release" | |
needs: bump | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
if: ${{ needs.bump.outputs.new_tag != null }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set env | |
run: | | |
echo "ASSET_DIR=package" >> $GITHUB_ENV | |
echo "ASSET_BASE_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV | |
echo "RELEASE_VERSION=${{ needs.bump.outputs.new_version }}" >> $GITHUB_ENV | |
echo "RELEASE_VERSION_TAG=${{ needs.bump.outputs.new_tag }}" >> $GITHUB_ENV | |
# Sets new X-KDE-PluginInfo-Version in metadata.json | |
- name: Update plasmoid version | |
run: echo "`jq '.KPlugin.Version="'$RELEASE_VERSION'"' $ASSET_DIR/metadata.json`" > $ASSET_DIR/metadata.json | |
# Creates plasmoid package | |
- name: Package | |
run: | | |
cd $ASSET_DIR | |
zip -r ../$ASSET_BASE_NAME-$RELEASE_VERSION.plasmoid * | |
cd .. | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "*.plasmoid" | |
tag: ${{ env.RELEASE_VERSION_TAG }} | |
body: ${{ needs.bump.outputs.changelog }} | |
token: ${{ secrets.GITHUB_TOKEN }} |