diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0bb2f9a..6e7823f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,4 @@ --- -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json name: "Release" on: @@ -9,15 +8,18 @@ on: jobs: release: - if: ${{ github.repository == 'kilip/homeplay' }} name: Release runs-on: ubuntu-latest + permissions: + contents: write + packages: write steps: - name: Checkout uses: actions/checkout@v4 - - name: Create Release + - name: Setup workflow variables shell: bash + id: vars env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" run: | @@ -36,9 +38,27 @@ jobs: echo "Month release does not exist for year, setting patch number to 0" next_patch="0" fi + # Create release release_tag="${next_major_minor}.${next_patch}" - gh release create "${release_tag}" \ - --repo="${GITHUB_REPOSITORY}" \ - --title="${release_tag}" \ - --generate-notes + echo "release_tag=${release_tag}" >> $GITHUB_OUTPUT + echo "previous_tag=${previous_tag}" >> $GITHUB_OUTPUT + + + - name: Update CHANGELOG + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ github.token }} + toTag: ${{ steps.vars.outputs.previous_tag }} + fromTag: ${{ steps.vars.outputs.release_tag }} + + - name: Create Release + uses: ncipollo/release-action@v1.14.0 + with: + allowUpdates: true + draft: false + makeLatest: true + name: ${{ steps }} + body: ${{ steps.changelog.outputs.changes }} + token: ${{ github.token }} diff --git a/.vscode/settings.json b/.vscode/settings.json index 91ae24f..1da87a8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,5 +11,8 @@ "*.conf.sops": "toml" }, "sops.defaults.ageKeyFile": "age.key", - "ansible.python.interpreterPath": "/home/toni/code/homeplay/.venv/bin/python" + "ansible.python.interpreterPath": "/home/toni/code/homeplay/.venv/bin/python", + "yaml.schemas": { + "https://json.schemastore.org/github-workflow.json": "file:///home/toni/code/homeplay/.github/workflows/release.yaml" + } } diff --git a/play-service.yml b/play-service.yml index 07fc64e..8711142 100644 --- a/play-service.yml +++ b/play-service.yml @@ -9,11 +9,13 @@ ansible.builtin.include_role: name: service tags: always - - name: Ensure unused docker resources pruned - community.docker.docker_prune: - containers: true - images: true - networks: true - volumes: true - builder_cache: true - tags: prune + - name: Ensure unused docker image pruned + ansible.builtin.command: + argv: + - docker + - image + - prune + - -a + - -f + changed_when: false + tags: prune,always