Release #22
This file contains hidden or 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: | |
| workflow_dispatch: | |
| inputs: | |
| beta: | |
| description: "Beta release. Build the beta branch and mark the GitHub release as a pre-release." | |
| required: false | |
| type: boolean | |
| default: false | |
| app-id: | |
| description: "App id to rebuild." | |
| required: false | |
| type: string | |
| default: "" | |
| reconcile: | |
| description: "Reconcile the index against the registry." | |
| required: false | |
| type: boolean | |
| default: false | |
| rebuild: | |
| description: "Force all apps to be rebuilt." | |
| required: false | |
| type: boolean | |
| default: false | |
| jobs: | |
| create-release: | |
| name: "Create CalVer Release" | |
| runs-on: ubuntu-latest | |
| needs: publish | |
| permissions: | |
| contents: write | |
| packages: write | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Generate CalVer Version and Tag | |
| id: calver | |
| shell: bash | |
| run: | | |
| git fetch --tags | |
| YYYY_MM=$(date +%Y.%m) | |
| LATEST_I=$(git tag -l "${YYYY_MM}.*" | sed "s/^${YYYY_MM}\.//" | sort -n | tail -n 1) | |
| if [ -z "$LATEST_I" ]; then | |
| NEW_VERSION="${YYYY_MM}.1" | |
| else | |
| NEW_VERSION="${YYYY_MM}.$((LATEST_I + 1))" | |
| fi | |
| echo "Release version: ${NEW_VERSION}" | |
| echo "version=${NEW_VERSION}" >> $GITHUB_OUTPUT | |
| - name: Configure Git | |
| run: | | |
| git config --local user.name "github-actions[bot]" | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Tag Repository | |
| env: | |
| TAG_NAME: ${{ steps.calver.outputs.version }} | |
| run: | | |
| git tag "$TAG_NAME" | |
| git push origin "$TAG_NAME" | |
| - name: Create GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG_NAME: ${{ steps.calver.outputs.version }} | |
| PAGES_URL: ${{ needs.publish.outputs.pages-url }} | |
| PRERELEASE: ${{ inputs.beta }} | |
| run: | | |
| sed 's/^ //' << EOF > release_notes.md | |
| For installation instructions, please refer to the repository landing page: | |
| $PAGES_URL | |
| EOF | |
| gh release create "$TAG_NAME" \ | |
| --title "Release $TAG_NAME" \ | |
| --notes-file release_notes.md \ | |
| --prerelease="$PRERELEASE" | |
| publish: | |
| name: "Publish to Flatpak Repo" | |
| permissions: | |
| contents: read | |
| packages: write | |
| pages: write | |
| id-token: write | |
| uses: ./.github/workflows/build-flatpak.yml | |
| with: | |
| branch: ${{ inputs.beta && 'beta' || 'stable' }} | |
| app-id: ${{ inputs.app-id }} | |
| reconcile-only: ${{ inputs.reconcile && inputs.app-id == '' }} | |
| force-all: ${{ inputs.rebuild || (!inputs.reconcile && inputs.app-id == '') }} | |
| dry-run: false | |
| secrets: | |
| gpg-private-key: ${{ secrets.AETHERPAK_GPG_KEY }} |